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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM