title: Using PL/JSON in oracle forms 11g
body: <p>I'm trying to use <a href="https://github.com/pljson/pljson/tree/master/src" rel="nofollow">PL/JSON</a> in a Oracle 11g form.  </p>
  
  <p>When I run the following code (taken from the example file ex1.sql of PL/JSON) directly on the database it works fine.</p>
  
  <pre><code>declare
    obj json;
  begin
    obj := json('{"a": true }');
  
    obj.print;
    --more complex json:
    obj := json('
  {
    "a": null,
    "b": 12.243,
    "c": 2e-3,
    "d": [true, false, "abdc", [1,2,3]],
    "e": [3, {"e2":3}],
    "f": {
      "f2":true
    }
  }');
    obj.print;
    obj.print(false); --compact way
  end;
  /
  </code></pre>
  
  <p>returning</p>
  
  <pre><code>{
    "a" : true
  }
  {
    "a" : null,
    "b" : 12.243,
    "c" : 0.002,
    "d" : [true, false, "abdc", [1, 2, 3]],
    "e" : [3, {
      "e2" : 3
    }],
    "f" : {
      "f2" : true
    }
  }
  {"a":null,"b":12.243,"c":0.002,"d":[true,false,"abdc",[1,2,3]],"e":[3,{"e2":3}],"f":{"f2":true}}
  </code></pre>
  
  <p>Now, I want to use the same logic but directly in a Oracle 11g form with the following code.</p>
  
  <pre><code>PROCEDURE Ex1_Test IS
    obj json;
  
  begin
    obj := json('{"a": true }');
  
    :MyField1 := obj.to_char;
    --more complex json:
    obj := json('
  {
    "a": null,
    "b": 12.243,
    "c": 2e-3,
    "d": [true, false, "abdc", [1,2,3]],
    "e": [3, {"e2":3}],
    "f": {
      "f2":true
    }
  }');
  
    :MyField2 := obj.to_char;
  
    :MyField3 := obj.to_char(false); --compact way
  
  end;
  </code></pre>
  
  <p>Then I get the generic internal error from Oracle <code>ORA-00600 : internal error code</code> at the line 7 <code>:MyField1 := obj.to_char;</code>.</p>
  
  <p>What am I doing wrong?  Is it that what I'm trying to do is not possible?</p>
  
  <p>Thank for the help! :)</p>