The EGL execute statement lets you write one or more SQL statements; in particular, SQL data-definition statements (of type CREATE TABLE, for example) and data-manipulation statements (of type INSERT or UPDATE, for example)
WHERE CURRENT OF resultSetID
Leave no space between #sql and the left brace.
If you specify a statement type (delete, insert, or update), EGL uses the SQL record to build an implicit SQL statement, as described later. In any case, you can use the SQL record to test the outcome of the operation.
If you do not set a statement type, you must specify either an explicit SQL statement or a reference to a prepare statement.
For an overview of implicit SQL statements, see SQL support.
execute #sql{ create table employee ( empnum decimal(6,0) not null, empname char(40) not null, empphone char(10) not null) }; execute update for employeeRecord; execute #sql{ call aStoredProcedure( :argumentItem) };
The effect of requesting an implicit SQL DELETE statement is that an SQL record property (defaultSelectCondition) determines what table rows are deleted, so long as the value in each SQL table key column is equal to the value in the corresponding key item of the SQL record. If you specify neither a record key nor a default selection condition, all table rows are deleted.
DELETE FROM tableName WHERE keyColumn01 = :keyItem01
You cannot use a single EGL statement to delete rows from more than one database table.
INSERT INTO tableName (column01, ... columnNN) values (:recordItem01, ... :recordItemNN)
UPDATE tableName SET column01 = :recordItem01, column02 = :recordItem01, ... columnNN = :recordItemNN WHERE keyColumn01 = :keyItem01
Related concepts
Record types and properties
SQL support
References to parts
Related tasks
Syntax diagram for EGL statements and commands