oracle PL/pgSQL 中 PL/SQL %NOTFOUND 的等价物是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3873514/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is the equivalent of PL/SQL %NOTFOUND in PL/pgSQL?
提问by Spredzy
Everything's in the title.
一切都在标题中。
I am Looping on a cursor and would like to have the
我在游标上循环并希望拥有
EXIT WHEN curs%NOTFOUND
when there is no more row, what is the equivalent of %NOTFOUND under PostgreSQL ?
当没有更多行时,PostgreSQL 下 %NOTFOUND 的等价物是什么?
Edit
编辑
Or the other cursors attributes %ISOPEN, %EMPTY, etc...
或者其他游标属性 %ISOPEN、%EMPTY 等...
回答by Kuberchaun
Can't test this right now but what if you try this? Check out section title 37.7.3.2. EXIT at this link http://www.postgresql.org/docs/8.2/static/plpgsql-control-structures.html
现在无法测试这个,但是如果你尝试这个怎么办?查看章节标题 37.7.3.2。在此链接退出 http://www.postgresql.org/docs/8.2/static/plpgsql-control-structures.html
IF NOT FOUND THEN
EXIT;
END IF;
OR
或者
EXIT WHEN NOT FOUND;