Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

extract column name , values from JSONB object and insert or update to database

Json format:

{
"attributeValue":[
{
"specName":"CUSTOMER_ID",
"specValue":"112345"
},
{
"specName":"CUSTOMER_TYPE",
"specValue":"12"
},
{
"specName":"CUSTOMER_FEATURES",
"specValue":"REPORT_GENERATION",
"specValueId":"223"
},
]
}

 

i might get n number of specname and spec value from the json object. extract the value dynamically and update or insert into target table.

 

In the above scenario

if a record is not present we will INSERT if record is already present we will update the value. how we can extract the column name and column value dynamically and insert or update the record (customer_id is primary key).

 

if we can not do dynamically say if we have fixed column names and column value how to do that. 

 

below is expectation when we run the job it will read the json object and insert/update  the target table data based on json object.

insert into customer(customer_id,CUSTOMER_TYPE,CUSTOMER_FEATURES,REPORT_TYPE) VALUES

(112345,12,'REPORT_GENERATION',223);

 

Labels (4)
1 Reply
fdenis
Master
Master