You can use a wizard to add an SQLJ assignment clause to an SQLJ
file. An SQLJ assignment clause assigns the result of an SQL operation to
a Java™ variable.
Prerequisite: The SQLJ file must be open in the SQLJ editor.
You can insert an SQLJ assignment clause anywhere in an SQLJ file
that a Java assignment statement can appear in a Java program.
To
add an SQLJ assignment clause:
- In the open SQLJ file, place the cursor at the location in the
code where you want to add the SQLJ assignment clause.
- Right-click at the insertion point, and then click on the pop-up menu.
- Use the wizard to do the following steps:
- Either select an existing SQL SELECT statement or create a new one.
- Specify other variables for the SQLJ clause, including the name of
the variable to which to assign the SQL SELECT operation.
- Optional: Specify the information for a new iterator declaration.
- On the Review SQLJ Clause page, click Finish.
The SQLJ assignment clause is added to the code at the insertion
point.