i created below stored procedure and passing Json data as input parameter...
CREATE OR REPLACE PROCEDURE JSON_CHECK(input_json CLOB)AS
x dual.dummy%type
BEGIN
SELECT dummy into x FROM DUAL WHERE input_json IS JSON;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RAISE_APPLICATION_ERROR(-20001,'INVALID JSON INPUT');
END;
Input
--------
execu input_json(
'{
"firstName": "Gerald",
"lastName": "Venzl",
"location": {
"country": "UK",
"city": "London",
"postCode": "EC2M"
}
}')
my requirement is
-------------------------
i have two tables
(a)employee
(b)address
i want to parse and insert the "firstName" and "lastName" values in employee table and
"city" and "postCode" values in address table.
is it possible to access individual parameters from the input parameter?How to insert?