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!

Return JSON into javascript object from Oracle

indy2005Sep 18 2019 — edited Sep 19 2019

Hi

Is there a way to populate a client side javascript object, for use in visualisation libraries like D3 or Paper.JS via APEX, without the REST service?

i.e. can I use the javascript API, or PL/SQL (APEX_JSON?) for example to run a query, and return into a client side javascript object the json response?

I know how to return JSON into a PL/SQL Dynamic Content region for example, but if I just want the data to get returned into a client side javascript object - whats the process?

declare

l_cursor sys_refcursor;

BEGIN

   OPEN l_cursor for SELECT A.UID,
cursor(SELECT PREFERRED_NAME FROM DIM_PRODUCT WHERE PRODUCT_ID = A.PRODUCT_ID) as PRODUCTS from ARIEL.MARKETED_PRODUCT A WHERE STATE = 'C';
   APEX_JSON.write(l_cursor);  

END;

Regards


Stephen

This post has been answered by fac586 on Sep 18 2019
Jump to Answer
Comments
Post Details
Added on Sep 18 2019
2 comments
719 views