您的位置:首页 > 数据库 > Oracle

oracle判断查询结果是否为空

2016-10-11 12:54 966 查看
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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: