It is possible to invoke the procedure to output a data table from a table definition directly from a SQL client. This is useful primarily for debugging and for developers.


Running in SQL (by platform)

PostgreSQL 

  1. Load the updated script

    \i /path/to/rpdo_refcursor.sql
  2. Run the procedure

    BEGIN;
     -- 'cur' is the default cursor name
     CALL usp_rpdo2(
       p_table_instance_id  := 322,
       p_result_instance_id := NULL,
       p_min_row            := NULL,
       p_max_row            := NULL
     );
     -- retrieve all rows from the cursor
     FETCH ALL FROM cur;
    COMMIT;

Notes:


Oracle

  1. Load the script

    @/path/to/your_oracle_script.sql
  2. Bind and call

    VAR rc REFCURSOR;
    EXEC usp_rpdo2(
     p_table_instance_id  => 322,
     p_result_instance_id => NULL,
     p_min_row            => NULL,
     p_max_row            => NULL,
     p_refcursor          => :rc
    );
  3. View the cursor

    PRINT rc;

Notes:


SQL Server 

  1. Load the script

    :r C:\path\to\rpdo2.sql
  2. Execute the procedure

    EXEC dbo.usp_rpdo2
     @TABLE_INSTANCE_ID  = 322,
     @RESULT_INSTANCE_ID = NULL,
     @MIN_ROW            = NULL,
     @MAX_ROW            = NULL;
  3. View results

Notes: