Constructing an EGL prepare statement
Within a function, you can construct the following kinds of EGL statements that are based on an SQL record part:
- An EGL prepare statement; and
- The related EGL execute, open, or get statement.
Do as follows:
- Open an EGL file with the EGL editor. The file must contain a function and a coded SQL statement. If you do not have a file open, right-click on the EGL file in the workbench Project Explorer, then select Open With > EGL Editor.
- Click inside the function at the location where the EGL prepare statement will reside, then right-click. A context menu displays.
- Select Add SQL Prepare Statement.
- Type a name to identify the EGL prepare statement. For rules, see Naming conventions.
- If you have an SQL record variable defined, select it from the drop-down list. The corresponding SQL record part name displays. If you do not have an SQL record variable defined, you can type a name in the SQL record variable name field, then select an SQL record part name using the Browse button. You must eventually define an SQL record variable with that name in the EGL source code.
- Select an execution statement type from the drop-down list.
- If the execution statement is of type open, enter a result-set identifier.
- Click OK. EGL statements are constructed inside the function.
Related concepts
SQL support
Related tasks
Validating the SQL SELECT statement for an SQL record
Viewing the SQL SELECT statement for an SQL record
Related reference
Naming conventions
SQL record part in EGL source format