OPEN_BULK_CURSOR_UDF (OBJECT, ARRAY)

Definition

This user-defined function (UDF) is used to open a cursor with bindings.

OPEN_BULK_CURSOR_UDF(CURSOR OBJECT, BINDINGS ARRAY)

Parameters

CURSOR OBJECT

The cursor to process as open.

BINDINGS ARRAY

The binding that is related to the cursor.

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, NULL)
        );
        Return MY_CURSOR;
    END;
$$;

CALL MY_PROCEDURE();

Output:

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

Last updated