12g
Hi Gurus,
I have a function that takes an input string. Inside the funtion I have a select that eventually I return as a Ref cursor to the calling procedure. In this function I have a sql to parse the Json response of a REST aPI call.
SELECT id, name
FROM json_table(ret FORMAT JSON, '$.items[*]'
COLUMNS (
id VARCHAR2 PATH '$.id',
name VARCHAR2 PATH '$.name'
));
In the select I want to add the parameter that I am passing since it needs to be one of the Refcursor fields. So if I have a variable e.g l_type:= 'Ops'; I want to select it in the select statement. This value remains the same for all rows of the RefCursor .
So something like
SELECT id, name,l_type
FROM json_table(ret FORMAT JSON, '$.items[*]'
COLUMNS (
id VARCHAR2 PATH '$.id',
name VARCHAR2 PATH '$.name'
));
Scratching my head a bit on how to do this simple select in the JSON_TABLE function. Just started using it so apologies if it seems simple.
Thanks!