我对 PL/SQL 中的游标术语有点生疏.有人知道吗?
I am a bit rusty on my cursor lingo in PL/SQL. Anyone know this?
隐式游标是 Oracle 在您执行查询时自动"为您创建的游标.编码更简单,但遭受
An implicit cursor is one created "automatically" for you by Oracle when you execute a query. It is simpler to code, but suffers from
示例
SELECT col INTO var FROM table WHERE something;
显式游标是您自己创建的游标.它需要更多代码,但提供更多控制权 - 例如,如果您只想要第一条记录并且不关心是否有其他记录,则可以只打开-获取-关闭.
An explicit cursor is one you create yourself. It takes more code, but gives more control - for example, you can just open-fetch-close if you only want the first record and don't care if there are others.
示例
DECLARE
CURSOR cur IS SELECT col FROM table WHERE something;
BEGIN
OPEN cur;
FETCH cur INTO var;
CLOSE cur;
END;
这篇关于Oracle 中的显式游标和隐式游标有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!