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!

inconsistency with how APEX_JSON escapes characters ?

NiallDec 8 2020

Hi all,
I think that I've found an interesting inconsistency with how APEX_JSON escapes characters.
When you use the apex_json.write signature that has a string as parameter it escapes the string.
However, when you use the apex_json.write signature that takes an xmltype as a parameter, it doesn't.
Example attached.
It seems to me that it should be one or the other. I suppose that in an ideal world, we'd be able to specify whether we want to turn escaping on or off.
Oracle Support document "Can Apex_json Not Escape Special Characters like "&" or "/" (Doc ID 2120249.1)" is pretty emphatic about escaping characters being the norm. So it's a little surprising to find this inconsistent behaviour.
What do you think?
All the best.
Niall.
apex_json_inconsistent.sql.txt (636 Bytes)

This post has been answered by Steve Muench-Oracle on Jun 6 2025
Jump to Answer
Comments
Post Details
Added on Dec 8 2020
3 comments
699 views