My Oracle Support Banner

How to generate an execution plan for JSON Dbms_soda procedure? (Doc ID 3012249.1)

Last updated on MARCH 28, 2024

Applies to:

Oracle Database - Enterprise Edition - Version 19.19.0.0.0 and later
Information in this document applies to any platform.

Goal

How to generate an execution plan for JSON Dbms_soda procedure?

DECLARE
  collection SODA_Collection_T;
  operation SODA_Operation_T;
  document SODA_Document_T;
  cur SODA_Cursor_T;
  qbe VARCHAR2(400);
status boolean;
  rowCount NUMBER;
BEGIN

  -- Open collection
  collection := dbms_soda.open_collection('GlobalSearchCollection');

  -- Define the filter specification (QBE)
  qbe := '{"$query" : {
  "memberno" : { "$eq" : "42249" }
  }
  }';

  -- Open a cursor for the filtered documents

  cur := collection.find().filter(qbe).get_cursor;

  -- Loop through the cursor
while cur.has_next
Loop
document := cur.next;
if document is not null THEN
DBMS_OUTPUT.put_line('Document components:');
  DBMS_OUTPUT.put_line('Key: ' || document.get_key);
  DBMS_OUTPUT.put_line('Content: ' || JSON_QUERY(document.get_clob, '$' PRETTY));
  DBMS_OUTPUT.put_line('Creation timestamp: ' || document.get_created_on);
  DBMS_OUTPUT.put_line('Last modified timestamp: ' || document.get_last_modified);
  DBMS_OUTPUT.put_line('Version: ' || document.get_version);
  END IF;
  END LOOP;
  status := cur.close;
END;
/
 

Solution

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Goal
Solution


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.