Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   SQL Statements >

CLOSE

Use the CLOSE statement when you no longer need to refer to the rows that a select or function cursor retrieved, or to flush and close an insert cursor.

Use this statement with ESQL/C.

Syntax

Read syntax diagramSkip visual syntax diagram>>-CLOSE--+-cursor_id------------+-----------------------------><
          |  (1)                 |
          '--------cursor_id_var-'
 
Notes:
  1. Informix extension
Element Description Restrictions Syntax
cursor_id Name of cursor to be closed Must have been declared Identifier
cursor_id_var Host variable that contains the value of cursor_id Must be of a character data type Must conform to language-specific rules for names.

Usage

Closing a cursor makes the cursor unusable for any statements except OPEN or FREE and releases resources that the database server had allocated to the cursor. A CLOSE statement treats a cursor that is associated with an INSERT statement differently from one that is associated with a SELECT or EXECUTE FUNCTION (or EXECUTE PROCEDURE) statement.

In a database that is not ANSI-compliant, you can close a cursor that has not been opened or that has already been closed. No action is taken in these cases.

In an ANSI-compliant database, the database server returns an error if you close a cursor that was not open.

Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]