I am trying to call a PLSQL procedure that has a record(header) and a table type(lines) as input parameters. I can change the procedure if required but at the end of the day, I need to create an item with a header and line. I saw some articles online and one mentioned that Table Types are not allowed in ORDS and only VARRAYS are allowed. Is this true? How can I implement this or is there any work around?
My handler source looks like this. This errors out as the record and table types are not passed properly.
DECLARE
x_return_code NUMBER;
x_return_msg VARCHAR2(200);
BEGIN
xx.xx_manage_item.create_item( p_req_id => :req_id,
p_header_rec => :header_rec,
p_sf_lines_tab => :lines_tab,
x_return_code => x_return_code,
x_return_msg => x_return_msg);
END;
My Post request looks like below: Lines can be multiple
{
"req_id":1,
"header_rec":{
"cust_account_id":"123",
"order_type":"XX",
"customer_po":"TestPO2",
"sales_person":"",
"currency_code":"USD",
"end_user_address":"Stockport 12",
"request_date":"09/10/2023"
},
"lines_tab":[
{
"inv_item_id":"112",
"item_name":"",
"quantity":"1",
"uom":"EA",
"plant_number":"w12",
"request_date":"09/10/2023"
}
]
}
Thanks in advance
Don't try to split the values into header and lines, just pass the entire JSON message to the procedure and process it there:
For example, you can create the procedure like this:
and then pass your message:
Which outputs:
fiddle