5 Replies Latest reply on Apr 8, 2019 3:16 PM by Pavel_p

    APEX_JSON.WRITE - Stop Converting Single Quotes in Values

    Pons-Oracle

      Hello Everyone, Need a bit of help with this one. I am working on a project where I need to generate some JSON out of some table data values. I am using APEX with Oracle REST Dataservices (ORDS). The values may contain single quote (') character. I don't want these quotes to get converted to unicode equivalents like \u0027

       

      For example, if I use the following PLSQL block to generate a simple JSON:-

       

      begin

          apex_json.open_object;

          apex_json.write('test','''test''');

          apex_json.close_object;

      end;

       

      The output is looking like below:

      {

      "test":"\u0027test\u0027"

      }

       

      Can't we force it to not translate the single quotes?

      {

      "test":"'test'"

      }

       

      Any help would be great. Thanks.

       

      Screenshots:

       

      Output: