<< EXECUTE IBEBLOCK | IBEBlock | INSERT INTO connection.table >>

EXECUTE STATEMENT

Executes specified SQL statement.

Syntax

  EXECUTE STATEMENT 'statement'
     [INTO :var [, :var ...]]
     [VALUES :var];
ArgumentDescription
'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 :varArray 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

See also:
EXECUTE STATEMENT ... AS DATASET
FOR EXECUTE STATEMENT ... DO

back to top of page
<< EXECUTE IBEBLOCK | IBEBlock | INSERT INTO connection.table >>