Apache Hive : HPL/SQL - CLOSE Statement

Last updated: August 12, 2026

Apache Hive : HPL/SQL - CLOSE Statement

CLOSE statement closes a cursor.

Syntax:

CLOSE cursor_name;

Parameters:

ParameterTypeValueDescription
cursor_nameIdentifierThe name of the previously opened cursor

Examples:

DECLARE id INT;
DECLARE cur CURSOR FOR 'SELECT id FROM db.orders';
OPEN cur;
FETCH cur INTO id;
CLOSE cur;

Compatibility: Oracle, IBM DB2, Teradata, SQL Server, PostgreSQL, MySQL.

See also: