ads

Monday, August 8, 2016

What is Parameterized Cursor in Oracle







What is Parameterized Cursor in Oracle.
In simple words a cursor with parameter is called parameterized cursor.
PL/SQL allows developer to pass parameters into cursors.
Same as like we can pass parameter into function and procedure.
PL/SQL Parameterized cursor pass the parameters into a cursor and use them in to query. Cursor becomes more reusable using Cursor parameters.

PL/SQL Parameterized cursor define only data type of parameter and not need to define it's length.

In Parameterized cursor scope of the parameters are local within program only.

Optionally, we can also give a default value for the parameter, which will take effect if no value is passed to the cursor.

Key point

1. Scope of the parameters are locally
2. You can assign default value to a cursor parameter.
3. Cursor becomes more reusable with Cursor parameters.
4.PL/SQL Parameterized cursor define only data type of parameter and not need to define it's length.

No comments:

Post a Comment