Progress
Embedded SQL-92
Guide and Reference


EXECUTE IMMEDIATE Statement

The EXECUTE IMMEDIATE statement is similar to using PREPARE and then EXECUTE. The EXECUTE IMMEDIATE statement accepts as input a character string or a host variable of character array type. A dynamic statement that will be executed with EXECUTE IMMEDIATE cannot contain any dynamic parameters.

EXAMPLES

The following examples show how to use the EXECUTE IMMEDIATE statement:

EXEC SQL BEGIN DECLARE SECTION ;
     char sql_str [256] ;
EXEC SQL END DECLARE SECTION ;
 
gets (sql_str) ;
 
EXEC SQL EXECUTE IMMEDIATE :sql_str ; 

A character string can be used in place of a host variable reference, as follows:

EXEC SQL EXECUTE IMMEDIATE
     "delete from customer where cust_no = 1001" ; 

The SQL string given to an EXECUTE IMMEDIATE statement should not have host variable references.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095