open()

variable.Open()

This method is used with the variables of the CURSOR data type to open the cursor previously declared by the Declare() method.

Usage

This method accepts no parameters. If it is a select cursor and the SELECT statement contains any placeholders, you should call SetParameters() method before using the Open() method. For an insert cursor the SetParameters() method can be called either before the Open() method or after it.

This method returns sqlca.sqlcode which is 0, if the cursor was opened successfully.

An example method call:

DEFINE cur_v CURSOR,

       par_v INT

...

CALL cur_v.Declare(SELECT * FROM customer WHERE customer.cust_id > ?")

LET par_v = 105

CALL cur_v.SetParameters(par_v) -- setting the parameter for the placeholder

CALL cur_v.Open() RETURNING err_code