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!

Error: SyntaxError: Unexpected end of JSON input

Geert01Nov 26 2021

I have a page that uses an Ajax Callback process to execute some plsql code. This works just fine.
But after adding a call to another (database) procedure, I am getting the error Unexpected end of JSON input.
My Ajax Call back process has the following lines (this was necessary to prevent the same Unexpected end of JSON input, error:
apex_json.open_object;
apex_json.write('success', true);
apex_json.close_object;
But the procedure that I added also uses :
apex_escape.set_html_escaping_mode('B');
apex_json.initialize_clob_output ();
apex_json.open_object ();
apex_json.write ('on', p_on);
apex_json.close_all ();
l_req_body := apex_json.get_clob_output ();
apex_json.free_output ();
When I deactivate this block, the error no longer appears. I have tried to solve this problem by making the procedure an autonomous transaction procedure, but that does not solve it.
I also tried adding the
apex_json.open_object;
apex_json.write('success', true);
apex_json.close_object;
lines to the end of the database procedure, but again, that does not solve the problem.
What can I do?
Kind regards
Geert

This post has been answered by Geert01 on Nov 27 2021
Jump to Answer
Comments
Post Details
Added on Nov 26 2021
1 comment
1,628 views