Home | Previous Page | Next Page   Programming with SQL > Dynamic SQL >

Quick Execution

For simple statements that do not require a cursor or host variables, you can combine the actions of the PREPARE, EXECUTE, and FREE statements into a single operation. The following example shows how the EXECUTE IMMEDIATE statement takes a character string, prepares it, executes it, and frees the storage in one operation:

EXEC SQL execute immediate 'drop index my_temp_index';

This capability makes it easy to write simple SQL operations. However, because no USING clause is allowed, the EXECUTE IMMEDIATE statement cannot be used for SELECT statements.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]