PreviousSQL Engine Reference (9.1 revision 1) Next

CLOSE

Show this topic in Library frames

Remarks

The CLOSE statement closes an open SQL cursor.

The cursor that the cursor name specifies must be open.

This statement is allowed only inside of a stored procedure or a trigger, since cursors and variables are only allowed inside of stored procedures and triggers.

Syntax

CLOSE cursor-name 

Examples

The following example closes the cursor BTUCursor.

CLOSE BTUCursor; 


CREATE PROCEDURE MyProc(IN :CourseName CHAR(7)) AS 
BEGIN 
DECLARE cursor1 CURSOR 
FOR SELECT Degree, Residency, Cost_Per_Credit 
FROM Tuition  ORDER BY ID; 
......... 
......... 
FETCH cursor1 INTO :CourseName; 
......... 
CLOSE cursor1; 
......... 
END

See Also

OPEN

CREATE PROCEDURE

CREATE TRIGGER


Chapter contents
Publication contents

Prev topic: CASE (string)
Next topic: COALESCE