meta data for this page
  •  

EXECUTE STATEMENT

Executes specified SQL statement.

Syntax

EXECUTE STATEMENT 'statement'
   [INTO :var [, :var ...]]
   [VALUES :var];
Argument Description
'statement' Any valid DML or DDL statement except CREATE/DROP DATABASE. DML statements may contain parameters.
INTO :var [, :var …] Specifies a list of variables into which to retrieve values. Only singleton SELECT operators may be executed with this form of EXECUTE STATEMENT.
VALUES :var Array of variants which values will be used to fill parameters if any exist in the statement.

Example

execute ibeblock
returns (TableName varchar(31))
as
begin
  TableID = 0;
  Stmt = 'select rdb$relation_name from rdb$relations where rdb$relation_id = :rel_id';
  while (TableID < 35) do
  begin
    execute statement :Stmt into :TableName values :TableId;
    suspend;
    TableID = TableID + 1;
  end
end