Difference between strong and weak ref_cursor in oracle

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

A strong ref_cursor will always be used to return a value, and the compiler knows the structure at compile time, but in a weak ref cursor it will not return a value, and the compiler does not know the structure at compile time.

This is the main difference, but my question is which value will be returned by the strong ref cursor and where this return value will be used.

+1
source share
2 answers

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

A weakly typed ref cursor has a return type that depends on the SQL statement it executes, that is, only once when the cursor is opened, the type is known (at run time). The compiler cannot determine the types until it is started, so care must be taken to ensure that the cursor result set is processed correctly to avoid run-time errors.

+7
source

There is another difference between a strong and a weak reference cursor, that a dynamic query is not possible in a strong reference cursor, where, as is possible in a weak reference cursor

0
source

All Articles