0 Replies Latest reply on Mar 26, 2016 11:43 AM by berx

    SQLcl - customize sqlformat json?

    berx

      I'm playing with 4.2.0.16.049.0842 right now.

       

      I try to spool the Output of a query into a json file to process it by another program later.

      at the moment a simple

      select sid, event, seq# from v$session where rownum < 3;

      results in

      {"results":[{"columns":[{"name":"SID","type":"NUMBER"},{"name":"EVENT","type":"NUMBER"},{"name":"SEQ#","type":"NUMBER"}],"items":
      [
      {"sid":1,"event":"lreg timer","seq#":5072},{"sid":2,"event":"EMON slave idle wait","seq#":55614}]}]}
      
      

       

      As the program which should process the json is not quite happy, I'd like to ask for some customization possibilities:

       

      1) obey the SET HEADING Parameter:
           with SET HEADING OFF it would be fine to surpress the full "columns": .... part.

      2) switch between one_JSON_per_resultset and one_JSON_per_row ?

       

      I'm aware this can be done by quite simple post processing scripts, still maybe it's a simple configuration Parameter as well.

       

      Martin