如下所示
create or replace trigger Tri_Update_Barcode_ar_info
after insert on ar_info
for each row
declare
-- local variables here
bar nvarchar2(15);
begin
select min(barcode) into bar from SYS_BARCODE where is_used=0; --将此值赋值给新值
update ar_info
set ar_barcode = bar
where ar_id = :new.ar_id;--报错位置 --commit;
end Tri_Update_Barcode_ar_info;
create or replace trigger Tri_Update_Barcode_ar_info
after insert on ar_info
for each row
declare
-- local variables here
bar nvarchar2(15);
begin
select min(barcode) into bar from SYS_BARCODE where is_used=0; --将此值赋值给新值
update ar_info
set ar_barcode = bar
where ar_id = :new.ar_id;--报错位置 --commit;
end Tri_Update_Barcode_ar_info;
before insert on ar_info
for each row
begin
select min(barcode) into :new.ar_barcode from SYS_BARCODE where is_used=0;
end Tri_Update_Barcode_ar_info;
create or replace trigger Tri_Update_Barcode_ar_info
before insert on ar_info
for each row
declare
-- local variables here
--bar nvarchar2(15);
begin
select min(barcode) into :new.ar_barcode from SYS_BARCODE where is_used=0; --把原表这个值的标志位置为1
update SYS_BARCODE
set IS_USED=1
where BARCODE=:new.ar_barcode;
--将此值赋值给新值
--update ar_info
--set ar_barcode = bar
--where ar_id = :new.ar_id;end Tri_Update_Barcode_ar_info;