Implicit Cursor attribute helper

An implicit cursor has attributes that return information about the most recently run SELECT or DML statement. This section explains how is this being emulated using Javascript.

Overview

These are the attributes that you can use inside Snowflake stored procedures using this helper:

  • FOUND

  • NOTFOUND

  • ROWCOUNT

  • ISOPEN

In Snowflake code, inside the procedures, you will find the initialization of these attributes:

 var SQL = {
  FOUND : false,
  NOTFOUND : false,
  ROWCOUNT : 0,
  ISOPEN : false
 };

The values of the attributes: FOUND, NOTFOUND, ROWCOUNT are updated inside the EXEC helper.

The attribute ISOPEN is always false, just like in Oracle.

Usage Samples

Input

Output

SQLCODE and SQLERRM are converted into helper variables with the same name, and are binded in the same way as the cursor variables.

Last updated

Was this helpful?