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!

Using APEX_JSON to return output in PL/SQL dynamic action

Scott WesleyOct 24 2018 — edited Oct 25 2018

Consider a basic page such as this one.

pastedImage_0.png

The button executes a dynamic action that populates an item based on some PL/SQL.

pastedImage_1.png

The 'raw' example populates P5_RAW with a JSON literal string.

pastedImage_2.png

P5_PKG is populated using apex_json

apex_json.initialize_clob_output;

apex_json.open_array;

apex_json.open_object;

apex_json.write('type', 'empty');

apex_json.close_object;

apex_json.close_array;

:P5_PKG := apex_json.get_clob_output;

apex_json.free_output;

The test case I just built in 18.2 works fine, but the P5_PKG case gave me an error in 5.1.3 (on 12.1)

pastedImage_9.png

This took me some time to isolate, and it appears the APEX_JSON package is conflicting with the mechanics of the 'Page items to return' attribute.

Interesting to see it's no longer a problem, but I'd really like to understand why.

And is there a workaround to allow usage of APEX_JSON, instead of building JSON manually, particularly this is on db 12.1.

Cheers

This post has been answered by Pierre Yotti on Oct 25 2018
Jump to Answer
Comments
Post Details
Added on Oct 24 2018
3 comments
1,517 views