I have a requirement to load data [ JSON format ] into an APEX table via ORDS Rest API.
So , I have created a POST handler within a module and below is the PL/SQL code for the handler
PL/SQL
begin
insert into PEEP(USER_ID,NAME,AGE,PROFESSION,LOCATION) values (:val1,:val2,:val3,:val4,:val5);
end;
CURL Command:
curl -s -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{"val1":"121","val2":"Rachel","val3":"37","val4":"Psychologist","val5":"Melbourne"}' https://xxxxx/ords/apex/peep/uploadinfo
The problem with the above approach is it inserts only one row with a single API call and if I give multiple rows with -d then it only inserts the first row and ignores the second row/input
Example
{"user_id" : 111,"name":"Sam","age":29,"profession":"Saxophonist","location":"Sydney"},{"user_id" : 121,"name":"Rachel","age":37,"profession":"Psychologist","location":"Melbourne"}
My requirement is to either take a JSON file as an input with the Curl Command or give multiple inputs with -d in curl command
Can someone please help me with this?