OPEN_BULK_CURSOR_UDF (OBJECT)

Definition

This user-defined function (UDF) is used to pen a cursor without bindings.

OPEN_BULK_CURSOR_UDF(CURSOR OBJECT)

Parameters

CURSOR OBJECT

The cursor to process as open.

Returns

Returns an object with the current information of the cursor.

Usage example

Input:


CREATE OR REPLACE TABLE BULKCOLLECTTABLE(test VARCHAR(100));

CREATE OR REPLACE PROCEDURE MY_PROCEDURE ()
RETURNS OBJECT
LANGUAGE SQL
EXECUTE AS CALLER
AS
$$
    DECLARE
        MY_CURSOR OBJECT := INIT_CURSOR_UDF('MY_CURSOR', '   SELECT * FROM
      BULKCOLLECTTABLE');

    BEGIN
        MY_CURSOR := (
            CALL OPEN_BULK_CURSOR_UDF(:MY_CURSOR)
        );
        Return MY_CURSOR;
    END;
$$;

CALL MY_PROCEDURE();

Output:

{
  "ISOPEN": true,
  "NAME": "MY_CURSOR",
  "QUERY": "   SELECT * FROM\n      BULKCOLLECTTABLE",
  "ROWCOUNT": 0
}

Last updated