Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deallocate cursor in PLSQL?

I code on both SQL Server and Oracle.
When I'm coding in SQL Server, I used this:

OPEN curUSERS;
CLOSE curUSERS;
DEALLOCATE curUSERS;

Now, when I'm coding in Oracle, I used this:

OPEN curUSERS;
CLOSE curUSERS;

I saw a DEALLOCATE keyword in PL/SQL but when I used this statement

DEALLOCATE(curUSERS);

It throws an error. How can I do the same thing (deallocation) in PL/SQL?

like image 565
marion-jeff Avatar asked Dec 26 '22 03:12

marion-jeff


1 Answers

Oracle doesn't require to deallocate cursor's memory explicitly. Just CLOSE(cursor) is fine.

like image 163
Ram Dwivedi Avatar answered Jan 13 '23 14:01

Ram Dwivedi