DECLARE vcount number; begin select count(*) into vcount from zhang.test where aname='t' and bname='t';
if vcount=0 then insert into zhang.test values(3,'t1','t1','t1','t1',50); else update zhang.test set abcount= abcount + 80 where aname='t' and bname='t'; end if; commit; end;
--创建存储过程 create or replace procedure record_new_order( rcount in number ) is vcount number; begin select count(*) into vcount from zhang.test where aname='t' and bname='t';
if vcount=0 then insert into zhang.test values(3,'t1','t1','t1','t1',rcount); else update zhang.test set abcount= abcount + rcount where aname='t' and bname='t'; end if; end; --执行存储过程-- begin record_new_order(10); end;
[code="sql"]DECLAREvcount number;beginselect count(*) into vcount from zhang.test where aname='t' and bname='t';if vcount=0 then insert into zhang.test values(3,'t1','t1','t1','t1',50);...