FREE (SQL statement)

Releases the resources allocated to a prepared statement.

Syntax

FREE sid 
  1. sid is the identifier of the prepared SQL statement.

Usage

The FREE instruction takes the name of a statement as parameter.

All resources allocated to the SQL statement handle are released.

After resources are released, the statement identifier cannot be referenced by a cursor, 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.

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