Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

APEX 5: APEX_JSON with Cursors

WobangAug 26 2015 — edited Oct 3 2015

Hello,

i got a little problem:

I want to create a json, that contains the results of 2 query. The structure should be like following:

{"query1":[--result of query 1----], "query2": [--result of query 2--]}

i'm trying the following:

     open l_cursor for v_proc;

     open l_cursor2 for v_val;

     apex_json.open_object;

     apex_json.write('query1', l_cursor);

     apex_json.write('query2', l_cursor2);

     apex_json.close_object;


where v_val and v_proc are variables with type sql-query


it's working as I'm getting a result, which contains all the rows. But the format is not valid JSON. It's something like:

{"query1":[--result of query 1----], "query2":,[--result of query 2--]}

----------------------------------------------^ this comma is misplaced and the reason for an invalid format

Everthing is fine, if I'm using just one cursor, but i would prefer to have both querys in one json.


I hope anyone can help.


Regards,

Wobang

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 31 2015
Added on Aug 26 2015
8 comments
1,734 views