EXECUTE IMMEDIATE (E-SQL)

The EXECUTE IMMEDIATE statement runs the embedded SQL statement contained in the specified host variable.

Syntax

EXECUTE IMMEDIATE :stmt_hvar

Arguments
stmt_hvar
Is a character string host variable that contains a Transact-SQL statement.
Remarks

The EXECUTE IMMEDIATE statement must conform to Transact-SQL statement rules. It cannot contain input parameter markers or host variables. It cannot return results; results returned from this statement are discarded. Additionally, the statement cannot contain keywords that pertain exclusively to ESQL/C.

If any rows are returned, SQLCODE is set to +1, which indicates an exception.

Examples

strcpy(prep, "DELETE FROM mf_table WHERE name='elaine'");

  

EXEC SQL EXECUTE IMMEDIATE :prep;

  

See Also

EXECUTE

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.