In Oracle, declare a cursor is a simple SELECT statement that is defined within the declaration section of your PLSQL code.
To declare a cursor without parameters in Oracle, use the following syntax:
Parameters:
cursor_name: The name of cursor.
select_statement: The select statement.
Note:
In the above example, the result set of this cursor is all firstName whose working_hover is equal to 6.
To declare a cursor with parameters in Oracle, use the following syntax:
Parameters:
cursor_name: The name of cursor.
parameter_list: List of parameters.
select_statement: The select statement.
Note:
In the above example, the result set of this cursor is all firstName whose working_hover is equal to 6, passed to the cursor via the parameter.
To declare a cursor with a return clause in Oracle/PLSQL, use the following syntax:
Parameters:
cursor_name: The name of cursor.
RETURN: The return value.
select_statement: The select statement.
Note:
In the above example, the result set of this cursor is all columns from the "tblCustomerLoan" where the working_hover is 6.