3. Statements : OpenROAD SQL Statements : Open Statement : Examples—Open Statement
 
Share this page                  
Examples—Open Statement
The following example opens emp_cursor as a read-only cursor, using the current value of the dept# variable in the where clause of the select statement:
open emp_cursor for select name, age
     from emp
     where dept = :dept#
     for readonly;
The following example opens emp_cursor so that the user can update the age column:
open emp_cursor for select name, age
     from emp
     where dept = :dept#
     for direct update of age;