日期:2014-05-17 浏览次数:20889 次
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;
------解决方案--------------------
把declare去掉。