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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

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

mNem
Answer

did you try right-click on the project name from Projects panel and Copy ... option?

Marked as Answer by OTG-467455 · Sep 27 2020
mNem

If I were you, for "exploring different scenarios", I would just stick with creating a new class (copy the existing one if you like) and make modifications all in the same project (instead of cloning the entire project).

HTH.

OTG-467455

Hi mNem,  Both of your suggestions are good.  I just wanted to create a replica, mess around and then drop it.  So the clone works just right for me.  Thanks for your quick thinking.

1 - 3

Post Details

Added on Nov 26 2021
1 comment
1,597 views