Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   SQL Statements > EXECUTE IMMEDIATE >

Examples of the EXECUTE IMMEDIATE Statement

The following examples show EXECUTE IMMEDIATE statements in ESQL/C. Both examples use host variables that contain a CREATE DATABASE statement. The first example uses the SQL statement terminator ( ; ) inside the quoted string.

sprintf(cdb_text1, "create database %s;", usr_db_id);
EXEC SQL execute immediate :cdb_text;

sprintf(cdb_text2, "create database %s", usr_db_id);
EXEC SQL execute immediate :cdb_text;

Related Information

Related statements: EXECUTE , FREE , and PREPARE

For a discussion of quick execution, see the IBM Informix Guide to SQL: Tutorial.

Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]