SQL/MX 2.x Reference Manual (H06.04+)

Embedded-Only SQL/MX Statements
HP NonStop SQL/MX Reference Manual540440-003
3-18
DEALLOCATE PREPARE Statement
DEALLOCATE PREPARE Statement
Considerations for DEALLOCATE PREPARE
C Examples of DEALLOCATE PREPARE
COBOL Examples of DEALLOCATE PREPARE
The DEALLOCATE PREPARE statement deallocates a prepared SQL statement in a
host program. It releases resources held by the prepared statement and allows you to
reuse the name of the statement.
Use DEALLOCATE PREPARE only in embedded SQL programs in C or COBOL.
statement-name
is an SQL identifier—the name of a prepared statement to deallocate. The module
that contains the DEALLOCATE PREPARE statement must also contain a
PREPARE statement for statement-name. See Identifiers on page 6-52.
ext-statement-name
is a value-specification—a host variable with character data type. When
DEALLOCATE PREPARE executes, the content of the value-specification
must identify a statement previously prepared within the scope of DEALLOCATE
PREPARE. The prepared statement must be a cursor specification.
GLOBAL | LOCAL
specifies the scope of the prepared statement. The default setting is LOCAL. A
GLOBAL prepared statement can be executed within the SQL session. A LOCAL
prepared statement can be executed only within the module or compilation unit in
which it was prepared.
A prepared SQL statement must be currently available whose name is the value of
ext-statement-name and whose scope is the same scope as specified in the
DEALLOCATE PREPARE statement.
DEALLOCATE PREPARE SQL-statement-name
SQL-statement-name is:
statement-name | ext-statement-name
ext-statement-name is:
[GLOBAL | LOCAL] value-specification
C/COBOL