Deallocates a dynamic SQL statement that was prepared in a prepare statement.
exec sql [at connection_name] deallocate prepare statement_name;
The identifier assigned to the dynamic SQL statement when the statement was prepared.
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;
A statement must be prepared before it is deallocated. Attempting to deallocate a statement that has not been prepared results in an error.
statement_name must uniquely identify a statement buffer and must conform to the SQL identifier rules for naming variables. statement_name can be either a literal or a character array host variable.
The deallocate prepare statement closes and deallocates any dynamic cursors declared for statement_name.
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.
declare cursor (dynamic), execute, execute immediate, prepare