Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Json data as input parameter

user549774Mar 21 2016 — edited Mar 21 2016

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?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 18 2016
Added on Mar 21 2016
6 comments
2,421 views