<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic extract column name , values from JSONB object and insert or update to database in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/extract-column-name-values-from-JSONB-object-and-insert-or/m-p/2225827#M17968</link>
    <description>&lt;P&gt;Json format:&lt;/P&gt; 
&lt;P&gt;{&lt;BR /&gt;"attributeValue":[&lt;BR /&gt;{&lt;BR /&gt;"specName":"CUSTOMER_ID",&lt;BR /&gt;"specValue":"112345"&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"specName":"CUSTOMER_TYPE",&lt;BR /&gt;"specValue":"12"&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"specName":"CUSTOMER_FEATURES",&lt;BR /&gt;"specValue":"REPORT_GENERATION",&lt;BR /&gt;"specValueId":"223"&lt;BR /&gt;},&lt;BR /&gt;]&lt;BR /&gt;}&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;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.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;In the above scenario&lt;/P&gt; 
&lt;P&gt;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).&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;if we can not do dynamically say if we have fixed column names and column value how to do that.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;below is expectation when we run the job it will read the json object and insert/update&amp;nbsp; the target table data based on json object.&lt;/P&gt; 
&lt;P&gt;insert into customer(customer_id,CUSTOMER_TYPE,CUSTOMER_FEATURES,REPORT_TYPE) VALUES&lt;/P&gt; 
&lt;P&gt;(112345,12,'REPORT_GENERATION',223);&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 04:47:43 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-16T04:47:43Z</dc:date>
    <item>
      <title>extract column name , values from JSONB object and insert or update to database</title>
      <link>https://community.qlik.com/t5/Talend-Studio/extract-column-name-values-from-JSONB-object-and-insert-or/m-p/2225827#M17968</link>
      <description>&lt;P&gt;Json format:&lt;/P&gt; 
&lt;P&gt;{&lt;BR /&gt;"attributeValue":[&lt;BR /&gt;{&lt;BR /&gt;"specName":"CUSTOMER_ID",&lt;BR /&gt;"specValue":"112345"&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"specName":"CUSTOMER_TYPE",&lt;BR /&gt;"specValue":"12"&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"specName":"CUSTOMER_FEATURES",&lt;BR /&gt;"specValue":"REPORT_GENERATION",&lt;BR /&gt;"specValueId":"223"&lt;BR /&gt;},&lt;BR /&gt;]&lt;BR /&gt;}&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;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.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;In the above scenario&lt;/P&gt; 
&lt;P&gt;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).&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;if we can not do dynamically say if we have fixed column names and column value how to do that.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;below is expectation when we run the job it will read the json object and insert/update&amp;nbsp; the target table data based on json object.&lt;/P&gt; 
&lt;P&gt;insert into customer(customer_id,CUSTOMER_TYPE,CUSTOMER_FEATURES,REPORT_TYPE) VALUES&lt;/P&gt; 
&lt;P&gt;(112345,12,'REPORT_GENERATION',223);&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 04:47:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/extract-column-name-values-from-JSONB-object-and-insert-or/m-p/2225827#M17968</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T04:47:43Z</dc:date>
    </item>
    <item>
      <title>Re: extract column name , values from JSONB object and insert or update to database</title>
      <link>https://community.qlik.com/t5/Talend-Studio/extract-column-name-values-from-JSONB-object-and-insert-or/m-p/2225828#M17969</link>
      <description>have a look at textractJsonFields &lt;A href="https://help.talend.com/reader/jomWd_GKqAmTZviwG_oxHQ/Z7vp_~tJvB~UohrQmhu8SQ" target="_blank" rel="nofollow noopener noreferrer"&gt;https://help.talend.com/reader/jomWd_GKqAmTZviwG_oxHQ/Z7vp_~tJvB~UohrQmhu8SQ&lt;/A&gt;&lt;BR /&gt;good luck</description>
      <pubDate>Wed, 04 Sep 2019 08:33:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/extract-column-name-values-from-JSONB-object-and-insert-or/m-p/2225828#M17969</guid>
      <dc:creator>fdenis</dc:creator>
      <dc:date>2019-09-04T08:33:47Z</dc:date>
    </item>
  </channel>
</rss>

