Posts

Showing posts with the label json

APEX_JSON - How to build Nested JSON

I have been came across requirement for printing nested JSON in one of the application. Using APEX_JSON, there is no straight forward way - I can just print a cursor or ref-cursor to an output as nested JSON. So, I have to write a pl/sql block and manually build JSON output. Purpose of this blog is to share a PL/SQL block which can build a nested JSON. Following is one  sample PL/SQL block to print employee-manager-employee hierarchy. DECLARE   l_return clob;   l_curr_level number := 1;   l_counter number;   l_empno emp.empno%type;   l_ename emp.ename%type;   l_job emp.job%type;   l_sal emp.sal%type;   l_level number;   l_is_open boolean := false;   l_emp_r emp%rowtype;   l_cursor sys_refcursor; BEGIN   IF :P17_ROOT IS NOT NULL THEN     APEX_JSON.initialize_clob_output;          select *       into l_emp_r       from emp     ...

Apex Office Print (AOP) - Error: SyntaxError: Unexpected token % in JSON at position 0

Image
Apex Office Print is one of the popular tool for generating documents using Oracle APEX. While using AOP process type plugin, you will commonly see following error message. Error: SyntaxError: Unexpected token % in JSON at position 0 Above error has nothing to do with AOP settings or anything else. Following is simple solution: 1. Open Page properties and check the Advance > Reload on Submit setting. 2. Make sure it is "Always". Save the changes and check again. Hope this helps! Regards, Jaydip Bosamiya jbosamiya@gmail.com
My photo
Jaydip Bosamiya
I am Oracle APEX Consultant, Blogger and Integrator. All-rounder in building small, medium and enterprise applications. Extensive knowledge in various area of web-driven applications in Back-end (PL/SQL, SQL, Java), Front-end (Oracle APEX, HTML, JavaScript, CSS, jQuery, OracleJET, ReactJS), RESTful APIs, Third-party library integrations (Apex Office Print (AOP), Payment Gateways, Syncfusion, HighCharts) and APEX Plugins (HighChart, StarRating)