Cursor methods

 

These methods are used to manipulate a cursor as an object not as an identifier.

 

The cursor methods are used  with variables of the CURSOR data type, declared in the same way as the variables of simple data types.

The cursor variables allow using cursors of different scopes of reference an passing them to functions.

 

 open()

opens the cursor previously declared by the declare() method

declare()

initializes a CURSOR variable and  assigns it to a cursor

put()

passes a row to the insert buffer

flush()

inserts the data from the buffer into database tables

getName()

gets a name to the cursor

getStatement()

returns the text of the SELECT or INSERT statement for which the cursor was declared

setParameters()

sets the values for the placeholders

foreach()

repeatedly executes a statement block in an action part of a rule

fetchNext()

retrieves the next row from an active set

fetchFirst()

retrieves the first row from an active set

fetchPrevious()

retrieves the previous row from an active set

fetchLast()

retrieves the last row from an active set

fetchRelative()

retrieves the nth row, relative to the current cursor position in the active set

fetchAbsolute()

retrieves the nth row in active set where row_position = n (starting from n=1)

setResults()

sets the cursor output values

free()

frees the cursor associated with the CURSOR variable

close()

closes the cursor