Hi all,
I am working on REST APIs to integrate with an external frontend. The task is to accept a collection of JSON arrays.
The problem is I understand how to accept objects but I don’t understand how to accept arrays using the ORDS platform. An example can be:
{ "users": [
{ "name": "adam", },
{ "name": "susan", }
] }
You can accept JSON array inputs via type object using PL/SQL in Oracle ORDS. Below is an example:
Create a table to store the data:
Create a DB package with TYPE declaration:
Now enable the above DB package for ORDS:
Calling the package:
Please try and let me know if any issues.
Hi Vinish, when trying to enable the object I am getting an insufficient privilege on apex. When I try enabling the privilege by using `grant all privileges on user USERNAME to ORDS_METADATA;` it still shoots the same error.
From which user you are trying to enable it?
Try to run the script in from your schema only. If it fails, then try to run from the SYS user.
Normally on AWS RDS you don’t get SYS. Anyways I figure the problem out and it works. Concerning the grant, you need to always grant to the rest public user. Other than that your explanation works like a charm.