Skip to Main Content

SQL & PL/SQL

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!

JSON_OBJECT_T and special characters

AndyPolAug 25 2022

Hi everybody
Oracle 18C EE
I have problem with below code:

declare
  l_json_clob clob;
  l_response_json_obj JSON_OBJECT_T;
 begin
    l_json_clob := '{
    ''guid'': ''E705128E85D30A7DE0530D00000A7B46'',
    ''http_code'': 200,
    ''http_body'': ''{"result":"error","error":"Could not find order - please make sure you\''ve entered the filename correctly"}'',
    ''call_duration'': 1.299151
}';
 l_response_json_obj:= new json_object_t(l_json_clob);
end;

It gives me ORA-40472

The problem is with apostrophe in "http_body" node:

..you\''ve..

Do you know how to escape " ' " ?

This post has been answered by Solomon Yakobson on Aug 25 2022
Jump to Answer
Comments
Post Details
Added on Aug 25 2022
9 comments
3,586 views