declare
v_id number;
begin
select CARLIST_SEQ.nextval into v_id from dual;
insert into carlist (id ,carname) values (v_id,'车1');
insert into carlist2 (carlist_id ,name2) values (v_id,'车2');
end;
------解决方案--------------------
SQL code
create or replace procedure proc_insertcarlist(carname1 varchar2, carname2 varchar2)
is
v_id number;
begin
select CARLIST_SEQ.nextval into v_id from dual;
insert into carlist (id ,carname) values (v_id,carname1);
insert into carlist2 (carlist_id ,name2) values (v_id,carname12);
end proc_insertcarlist;
------解决方案-------------------- 直接寫觸發器作用在CarList表,insert CarList表時同步insert到carlist2表。
------解决方案--------------------