Reputation: 5
I'm trying to use PL/JSON in a Oracle 11g form.
When I run the following code (taken from the example file ex1.sql of PL/JSON) directly on the database it works fine.
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;
/
returning
{
"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}}
Now, I want to use the same logic but directly in a Oracle 11g form with the following 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;
Then I get the generic internal error from Oracle ORA-00600 : internal error code
at the line 7 :MyField1 := obj.to_char;
.
What am I doing wrong? Is it that what I'm trying to do is not possible?
Thank for the help! :)
Upvotes: 0
Views: 2274
Reputation: 146179
ORA-00600 is Oracle's code for "unhandled side effects" ie bugs. There should be some additional information in the alert log. The standard ORA-00600 advice is to contact Oracle Support.
If you don't have a Support contract your options are limited. The ORA-00600 message should come with one or more arguments in square brackets, like this
ORA-00600: internal error code, arguments: [17069], [55573516], [], [], [], [], [], []
Those arguments are useful for identifying specific causes (the first number usually indicates an Oracle error number, documented or otherwise). You can try Googling for them.
As to your specific case I'm afraid we can only speculate. The object method JSON.TO_CHAR()
calls a PL/SQL package function,JSON_PRINTER
. That may be the problem. Forms PL/SQL shares a syntax with database PL/SQL but they are different engines; it may be you have come across a bug in how Forms PL/SQL works with SQL Types which have dependencies.
Upvotes: 1