FREE (SQL statement)
Releases the resources allocated to a prepared statement.
Syntax
FREE sid
- sid is the identifier of the prepared SQL statement.
Usage
The FREE
instruction takes the name of a statement as parameter and releases
the resources allocated by the PREPARE
instruction.
After using FREE
, the statement identifier cannot be referenced by a cursor
declaration (DECLARE
), or by the
EXECUTE
statement, until you
prepare the statement again.
Free the statement if it is not needed anymore, this saves resources on the database client and database server side.
Example
FUNCTION update_customer_name( key, name )
DEFINE key INTEGER
DEFINE name CHAR(10)
PREPARE s1 FROM "UPDATE customer SET name=? WHERE customer_num=?"
EXECUTE s1 USING name, key
FREE s1
END FUNCTION