deallocate prepare

Description

Deallocates a dynamic SQL statement that was prepared in a prepare statement.

Syntax

exec sql [at connection_name] 
 deallocate prepare statement_name;

Parameters

statement_name

The identifier assigned to the dynamic SQL statement when the statement was prepared.

Examples

Example 1

exec sql begin declare section; 
   CS_CHAR        sqlstmt[100]; 
 exec sql end declare section; 
strcpy(sqlstmt, “select * from publishers”);
exec sql prepare make_work from :sqlstmt;
exec sql declare make_work_cursor cursor for
     make_work;
exec sql deallocate prepare make_work;

Usage

WARNING! If you are using persistent binds in your embedded SQL program, use the deallocate prepare statement carefully. Needlessly deallocating prepared statements can negate the advantage of persistent binds.

See also

declare cursor (dynamic), execute, execute immediate, prepare