close

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

close [2015/09/23 20:26] (current)
Line 1: Line 1:
 +====== CLOSE Statement - PL/HQL Reference ======
  
 +CLOSE statement closes a cursor.
 +
 +**Syntax**:
 +
 +<code language=sql>​
 +CLOSE cursor_name;​
 +</​code>​
 +
 +**Parameters:​**
 +
 +| **Parameter** | **Type** | **Value** | **Description** |
 +| cursor_name | | Identifier | The name of the previously opened cursor |
 +
 +**Examples:​**
 +
 +<code language=sql>​
 +DECLARE id INT;
 +DECLARE cur CURSOR FOR '​SELECT id FROM db.orders';​
 +OPEN cur;
 +FETCH cur INTO id;
 +CLOSE cur;
 +</​code>​
 +
 +**Compatibility:​** Oracle, IBM DB2, Teradata, SQL Server, PostgreSQL, MySQL.
 +
 +**See also:**
 +  * [[declare-cursor|DECLARE CURSOR]]
 +  * [[open|OPEN]]
 +  * [[fetch|FETCH]]
 +  * [[sqlcode|SQLCODE]]