Difference between strong and weak ref_cursor in oracle

孤人 提交于 2019-12-24 10:49:07

问题


I want to know the practical difference between strong and weak ref cursor.

Strong ref_cursor will always use to return a value and compiler know the structure during the compile time, but in the weak ref cursor it will not return a value and compiler dosen't know the structure during the compile time.

This is the basic difference but my question is what value will be returned by the strong ref cursor and where that returned value will be used.


回答1:


A strongly typed ref cursor always returns a known type, usually from a declared TYPE object. The compiler can find problems in a PL/SQL block by comparing the types returned to how they are used.

A weakly typed ref cursor has a return type that is dependant on the SQL statement it executes, i.e. only once the cursor is opened is the type known (at runtime). The compiler cannot determine the types until it is ran, so care must be taken to ensure that the cursor result set is handled properly to avoid runtime errors.




回答2:


there is one more difference between strong and weak reference cursor is that dynamic query is not possible in strong reference cursor where as it is possible in weak reference cursor



来源:https://stackoverflow.com/questions/6042568/difference-between-strong-and-weak-ref-cursor-in-oracle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!