DataGrip
 
Get DataGrip
You are viewing the documentation for an earlier version of DataGrip.

Code Inspection: Illegal cursor state

Last modified: 13 May 2022

Reports illegal cursor states inside SQL routines.

  • A routine has CLOSE or FETCH statements but a cursor might be closed.

  • A routine has the OPEN statement but a cursor might be opened.

Example (Microsoft SQL Server):

According to CLOSE (Transact-SQL) at docs.microsoft.com, CLOSE must be issued on an open cursor, and CLOSE is not allowed on cursors that have only been declared or are already closed. So, we need to open the cursor to fix the warning.