Reputation: 59
I am trying to update fields of a table using a JSON_OBJECT_T's elements. However, I am getting
ORA-40573: Invalid use of PL/SQL JSON object type.
Example:
metadata := JSON_OBJECT_T.parse(json_clob)
insert into catimage (
OBJECTID,
OBJTYPE,
values(
sde.gdb_util.next_rowid('CISCAT', 'CATIMAGE'),
metadata.get_String('objtype'), --OBJTYPE
)
I don't get the error if I set each field I require from the JSON_OBJECT_T as a variable. Is that the only way?
Thank you. Jon
Upvotes: 1
Views: 3239
Reputation: 59
The ORA issue has yet to be patched. Workaround as suggested by the article is to manually set all variables before insert.
Upvotes: 3
Reputation: 1164
It would have helped to view the table DDL and variable definition.
However, given the limited information shared in the question, you might be hitting a bug related to insertion of JSON objects using PLSQL.
The suggested workaround is to put the data into a string variable and inserting the data into table. Hope it helps
Upvotes: 0