17,377
社区成员
发帖
与我相关
我的任务
分享
declare
cid number(20);
begin
select a.id into cid from b_table a where a.mac='911:34:34:34:GG:GG';
if cid >0
then
update 语句;
else
insert 语句;
end if;
commit;
exception
when others then
rollback;
end;
declare
cid number(20);
begin
select count(a.id) into cid from b_table a where a.mac='911:34:34:34:GG:GG';
if cid >0
then
select a.id into cid from b_table a where a.mac='911:34:34:34:GG:GG';
update 语句;
else
insert 语句;
end if;
commit;
exception
when others then
rollback;
end;