oracle判断查询结果是否为空

create table test1023(id int);   --创建测试表 test1023

declare cnt int;
begin
select count(*) into cnt from test1023;
if cnt=0 then
insert into test1023 values('1');
commit;  --触发器中 需要将这句删除;
end if;
end;

参:http://zhidao.baidu.com/link?url=WruRf6fvsDrqjIuESnzcwi0CVDT5b3lT8s1rncvbTCdvoOiKY9CcFa1BPoJw_IEyRi4kJWfhXJ9v4XoUAi4tl4fw7_M1dsVLakV2rcQKLna

原文地址:https://www.cnblogs.com/wangfuyou/p/5948850.html