Informix nonupdatable cursors
Declaring a cursor is similar to declaring a variable; a cursor
is a nonexecutable statement just like a variable declaration. The
first step in declaring a nonupdatable cursor is to define how the
result set looks. To do this, you need a SELECT statement. You must
associate the result set with a logical name so you can refer to
it in subsequent SQL statements.
Example
Assume the SingleLineEdit control sle_1 contains
the state code for the retrieval:
The script for the Clicked event for the CommandButton Cb_Extract
is:
1 |
// Declare cursor emp_curs for employee table.<br>// retrieval<br> <br>DECLARE emp_curs CURSOR FOR<br> SELECT emp_id, emp_name FROM Employee <br> WHERE emp_state = :sle_1.text;<br> <br>// Declare local variables for retrieval.<br>string emp_id_var<br>string emp_name_var<br> <br>// Execute the SELECT statement with <br>// the current value of sle_1.text.<br>OPEN emp_curs;<br> <br>// At this point, if there are no errors, <br>// the cursor is available for further processing. |
Document get from Powerbuilder help
Thank you for watching.
Subscribe
Login
0 Comments