<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Informatica Archives | ZappySys Blog</title>
	<atom:link href="https://zappysys.com/blog/tag/informatica/feed/" rel="self" type="application/rss+xml" />
	<link>https://zappysys.com/blog/tag/informatica/</link>
	<description>SSIS / ODBC Drivers / API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more</description>
	<lastBuildDate>Thu, 30 Mar 2023 17:18:58 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.4</generator>

<image>
	<url>https://zappysys.com/blog/wp-content/uploads/2023/01/cropped-zappysys-symbol-large-32x32.png</url>
	<title>Informatica Archives | ZappySys Blog</title>
	<link>https://zappysys.com/blog/tag/informatica/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Export / Create JSON File in Informatica (from SQL Query / Database Tables)</title>
		<link>https://zappysys.com/blog/export-create-json-file-informatica-sql-query-database-tables/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Thu, 30 Mar 2023 17:17:30 +0000</pubDate>
				<category><![CDATA[ZappyShell]]></category>
		<category><![CDATA[command line tools]]></category>
		<category><![CDATA[CSV]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[Informatica]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[xml]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=10020</guid>

					<description><![CDATA[<p>Introduction In this article, you will learn how to create simple or complex JSON file in Informatica just in a few clicks. We will use the Powerful Export JSON Command line Builder from ZappyShell. Using this Portable / xCopy style command line you can build nested/complex JSON / XML or even CSV from single / [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/export-create-json-file-informatica-sql-query-database-tables/">Export / Create JSON File in Informatica (from SQL Query / Database Tables)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p>In this article, you will learn how to create simple or complex JSON file in Informatica just in a few clicks. We will use the Powerful Export JSON Command line Builder from <a href="https://zappysys.com/products/zappyshell/data-export-command-line-tools-json-excel-csv-pdf/">ZappyShell</a>. Using this Portable / xCopy style command line you can build nested/complex JSON / XML or even CSV from single / multiple SQL Queries as Input or Select Database Tables as Source. Later you can copy generated command line from Tool and execute in any tool like Informatica / Talend / DataStage or Automation Script like Python / PowerShell.</p>
<h2>Prerequisite</h2>
<p>This article assumes you have access to Informatica Developer Tools and basic knowledge of command-line tools.</p>
<ol>
<li><a href="https://zappysys.com/products/zappyshell/">Download ZappyShell</a> Command line utility (Click on Download Button). You can get msi and Zip (Poratble / xCopy version)</li>
<li>If you want to use the Portable version just extract ZappyShell-xCopy zip to some folder lets say (C:\ZappyShell). If you installed MSI then its usually in C:\Program Files (x86)\ZappySys</li>
<li>Double click on DbCommandBuilder.exe <a href="https://zappysys.com/onlinehelp/zappyshell/index.htm#page=db/db.htm">as listed here</a>  to get started. At the end of this exercise, you will be able to generate something like the below JSON File in few clicks in Informatica or any other Tool / Programming Language you prefer which has option to invoke command line&#8230;</li>
<li>For all possible command line options <a href="https://zappysys.com/onlinehelp/zappyshell/scr/db/db-db-export.htm" target="_blank" rel="noopener">Refer this</a></li>
<li>So lets get started</li>
</ol>
<h2>Sample JSON Created by ZappyShell from Informatica</h2>
<p>&nbsp;</p>
<div style="width: 680px" class="wp-caption alignnone"><img fetchpriority="high" decoding="async" class="figureimage" title="Sample JSON Created by Informatica Workflow (Create From Database SQL Query or Tables)" src="https://zappysys.com/onlinehelp/zappyshell/scr/images/dbcommandbuilder/db-command-builder-json-custom-output.png" alt="Sample JSON Created by Informatica Workflow (Create From Database SQL Query or Tables)" width="670" height="626" /><p class="wp-caption-text">Sample JSON Created by Informatica Workflow (Create From Database SQL Query or Tables)</p></div>
<h2>Create Command Line to Export JSON File from Database SQL Query / Tables</h2>
<p>In this section, we will see how to build Command Line which you can then execute in Informatica Command Time and later Schedule Export Job to Produce JSON File on a predefined schedule or manually.</p>
<ol>
<li>Open DbCommandBuilder.exe and configure the Connection / Data source(s) <a href="https://zappysys.com/onlinehelp/zappyshell/index.htm#page=db/db.htm">as listed here</a> .<img decoding="async" class="figureimage" title="ZappyShell - Open Installed File or Directory" src="https://zappysys.com/onlinehelp/zappyshell/scr/images/open-zappyshell.png" alt="ZappyShell - Open Installed File or Directory" /></li>
<li>Select JSON Export Option from the Dropdown. You can also choose XML, Excel or CSV<img decoding="async" class="figureimage" title="XML file generate" src="https://zappysys.com/onlinehelp/zappyshell/scr/images/dbcommandbuilder/db-command-builder-xml.png" alt="XML file generate" /></li>
<li>You can use the Custom Layout Option if you wish to Export using custom Output Layout else just choose tables you like to export or type SQL query.<br />
<img decoding="async" src="https://zappysys.com/onlinehelp/zappyshell/scr/images/dbcommandbuilder/db-command-builder-json-custom-layout.png" alt="JSON Custom Layout" /></li>
<li>Configure your Input Dataset(s) (can be SQL Queries or Tables) and define Desired Layout for your Output File.<img decoding="async" src="https://zappysys.com/onlinehelp/zappyshell/scr/images/dbcommandbuilder/db-command-builder-json-custom-layout-add-dataset.png" alt="JSON Custom Layout - Add Dataset" /></li>
<li>Here is just an example of how to define an Array for a nested layout in a JSON or XML file.<img decoding="async" src="https://zappysys.com/onlinehelp/zappyshell/scr/images/dbcommandbuilder/db-command-builder-json-custom-layout-add-element-in-document-array.png" alt="Layout Editor to define Structure of JSON / XML Output" /></li>
<li>t the end of configuration you may see command line like below (more examples <a href="https://zappysys.com/onlinehelp/zappyshell/scr/db/db-db-export.htm">listed here</a>)<strong>Example: Simple mode Export (Microsoft SQL Server)</strong><br />
<pre class="crayon-plain-tag">db.exe export customers --json -o c:\data\cust.json --connstr "Data Source=localhost;Initial Catalog=Northwind;Integrated Security=SSPI;" -y</pre>
<strong>Example: For Simple mode Export (MySQL SQL Server &#8211; ODBC Driver)</strong><br />
<pre class="crayon-plain-tag">export customers --out c:\data\customers.json --json --overwrite --connstr "Driver={MySQL ODBC 5.2 ANSI Driver};Server=your_server_name_or_ip;Port=3306;Uid=user1;pwd=SomeP@ssword;Database=your_db_name"</pre>
<strong><strong>Example: For custom layout mode Export<br />
</strong></strong><br />
<pre class="crayon-plain-tag">export --map c:\data\MySampleMap.xml -o c:\data\customers.json --json --connstr "Data Source=localhost;Initial Catalog=Northwind;Integrated Security=SSPI;" -y</pre>
</li>
<li>Once the Command line is created you can click <strong>Run</strong> to test and then copy it into tools like Informatica Command Task (see next section).</li>
</ol>
<h2>Export / Create JSON File In Informatica</h2>
<ol>
<li>Once the command line is prepared (see previous section) we can open Informatica Developer (D)</li>
<li>Connect to your Repository and create a new workflow</li>
<li>Drag new Command Task, from Toolbox and double click to edit
<div id="attachment_10021" style="width: 691px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/03/informatica-command-task.png"><img decoding="async" aria-describedby="caption-attachment-10021" class="size-full wp-image-10021" src="https://zappysys.com/blog/wp-content/uploads/2023/03/informatica-command-task.png" alt="Informatica Command Task" width="681" height="281" srcset="https://zappysys.com/blog/wp-content/uploads/2023/03/informatica-command-task.png 681w, https://zappysys.com/blog/wp-content/uploads/2023/03/informatica-command-task-300x124.png 300w" sizes="(max-width: 681px) 100vw, 681px" /></a><p id="caption-attachment-10021" class="wp-caption-text">Informatica Command Task</p></div></li>
<li>Enter the sample command line we obtained from the previous step</li>
<li>Save the workflow and run it&#8230; That&#8217;s it you will see the JSON file generated</li>
</ol>
<h2>Export / Create XML File In Informatica</h2>
<p>Same Steps as above except choose File format as XML and you will see output like the below once you run the command line.</p>
<div style="width: 905px" class="wp-caption alignnone"><img decoding="async" class="figureimage" title="Export / Create XML File In Informatica" src="https://zappysys.com/onlinehelp/zappyshell/scr/images/dbcommandbuilder/db-command-builder-xml.png" alt="Export / Create XML File In Informatica" width="895" height="160" /><p class="wp-caption-text">Export / Create XML File In Informatica</p></div>
<h2>Export / Create CSV File In Informatica</h2>
<p>Same Steps as above except choose File format as CSV and you will see output like the below once you run the command line.</p>
<div style="width: 817px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="figureimage" title="Generate CSV Files in Informatica" src="https://zappysys.com/onlinehelp/zappyshell/scr/images/dbcommandbuilder/db-command-builder-csv-output.png" alt="Generate CSV Files in Informatica" width="807" height="507" /><p class="wp-caption-text">Generate CSV Files in Informatica</p></div>
<h2>Export / Create Excel File In Informatica</h2>
<p>Same Steps as above except choose File format as Excel and you will see output like the below once you run the command line.</p>
<p><img decoding="async" src="https://zappysys.com/onlinehelp/zappyshell/scr/images/export-sql-server-table-to-excel-split-by-column.png" alt="Export SQL Server Table to Excel files (split automatically using group by column)" /></p>
<h2>Conclusion</h2>
<p>In this post, we just saw how easy it is to generate JSON / XML / Excel or CSV files in tools like Informatica, Talend, python, PowerShell in few clicks without coding. You can schedule job to generate JSON / XML files from Database tables or SQL Query. <a href="https://zappysys.com/products/zappyshell/download/">Download ZappyShell</a> Today and try it to see what else you can do with it.</p>
<p>The post <a href="https://zappysys.com/blog/export-create-json-file-informatica-sql-query-database-tables/">Export / Create JSON File in Informatica (from SQL Query / Database Tables)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Using Custom Objects in ZappySys Drivers (Proc / View)</title>
		<link>https://zappysys.com/blog/odbc-drivers-custom-objects-feature/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Tue, 12 May 2020 23:54:41 +0000</pubDate>
				<category><![CDATA[ODBC PowerPack]]></category>
		<category><![CDATA[access]]></category>
		<category><![CDATA[Informatica]]></category>
		<category><![CDATA[ms access]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=8895</guid>

					<description><![CDATA[<p>Introduction ODBC PowerPack v1.2 release brought an interesting feature for all API drivers. New version gives you an ability to create Custom Objects. You can create parameterized Stored Procedure and Virtual Tables on the same Data Source (ODBC DSN or Data Gateway Data Source). For more information you see here Custom Objects There are mainly [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/odbc-drivers-custom-objects-feature/">Using Custom Objects in ZappySys Drivers (Proc / View)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p><a href="https://zappysys.com/blog/odbc-powerpack-1-2-0-released/" target="_blank" rel="noopener">ODBC PowerPack v1.2</a> release brought an interesting feature for all API drivers. New version gives you an ability to create Custom Objects. You can create parameterized Stored Procedure and Virtual Tables on the same Data Source (ODBC DSN or Data Gateway Data Source). For more information you <a href="https://zappysys.com/onlinehelp/odbc-powerpack/scr/json-odbc-driver-intro.htm" target="_blank" rel="noopener">see here</a></p>
<h2>Custom Objects</h2>
<p>There are mainly 3 types of custom objects you can create using ZappySys Drivers.</p>
<h3>Custom Stored Procedure</h3>
<p>You can create procedures to encapsulate custom logic and then only pass handful parameters rather than long SQL to execute your API call.</p>
<div style="width: 825px" class="wp-caption alignnone"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/odbc-powerpack/scr/images/json-driver/odbc-json-driver-create-procedure.png" alt="ZappySys ODBC Driver - Custom Objects - New Stored Procure " width="815" height="576" /><p class="wp-caption-text">ZappySys ODBC Driver &#8211; Custom Objects &#8211; New Stored Procure</p></div>
<h4><strong>Stored Procedure with Parameters</strong></h4>
<p>Here is an example stored procedure for JSON Driver. You can insert Placeholders anywhere inside Proc Body. <a href="https://zappysys.com/onlinehelp/odbc-powerpack/scr/odbc-format-static-placeholders.htm" target="_blank" rel="noopener">Read more about placeholders here</a></p><pre class="crayon-plain-tag">CREATE PROCEDURE usp_UploadData
 @file='test.json',
 @source='HRApp'
AS
SELECT * FROM $
WITH 
(METHOD='POST', HEADER='Content-Type: text/plain || x-hdr1: AAA'
,SRC='http://httpbin.org/post?src=&lt;@source&gt;&amp;timestamp=&lt;&lt;FUN_TODAY&gt;&gt;'
,BODY='@c:\files\&lt;@file,FUN_TRIM&gt;'
,IsMultiPart='True'
)</pre><p>
To call stored procedure from client app using below SQL. Must prefix EXEC proc_name [parameter values&#8230;.]
</p><pre class="crayon-plain-tag">EXEC usp_UploadData 'Jan_data1.json' , 'HRApp'</pre><p>
<h4><strong>Stored Procedure without Parameters</strong></h4>
<p><img decoding="async" src="https://zappysys.com/onlinehelp/odbc-powerpack/scr/images/json-driver/odbc-json-driver-modify-procedure.png" alt="ZappySys ODBC Driver : Without Parameters" /></p>
<h4><strong>Using Functions in Stored Procedure</strong></h4>
<p>ZappySys provides <a href="https://zappysys.com/onlinehelp/odbc-powerpack/scr/odbc-format-static-placeholders.htm" target="_blank" rel="noopener">many functions</a> which can be used as placeholder anywhere inside Stored Proc code or in your SQL query for Driver</p>
<p><strong>Example of simple function (No parameter)</strong></p><pre class="crayon-plain-tag">CREATE PROCEDURE usp_OrdersByCountry
 @country='INDIA' --always supply some default parameter so metadata can be guessed
AS
SELECT * FROM Orders
WHERE Country='&lt;@country,FUN_TRIM&gt;')</pre><p>
<strong>Example of function with parameters</strong></p>
<p>In below example we have invoked function after we replaced parameter. Our function FUN_TO_DATE has 2 parameters (actual date value and format we want to output). This way we can control replacement order</p><pre class="crayon-plain-tag">CREATE PROCEDURE usp_OrdersByDate
 @orderdate='2012-01-01'  --always supply some default parameter so metadata can be guessed
AS
SELECT * FROM Orders
WHERE OrderDate=DATETIME('&lt;&lt;&lt;@orderdate&gt;||yyyy-MM-dd,FUN_TO_DATE&gt;&gt;')</pre><p>
&nbsp;</p>
<h3>Virtual Table &#8211; Connection String Mode</h3>
<p>ZappySys Drivers support flexible Query language so you can override Default Properties you configured on Data Source such as URL, Body. This way you dont have to create multiple Data Sources if you like to read data from multiple EndPoints. However not every application support supplying custom SQL to driver so you can only select Table from list returned from driver.</p>
<p>Many applications like MS Access, Informatica Designer wont give you option to specify custom SQL when you import Objects. In such case Virtual Table is very useful. You can create many Virtual Tables on the same Data Source (e.g. If you have 50 URLs with slight variations you can create virtual tables with just URL as Parameter setting.</p><pre class="crayon-plain-tag"><strong>vt__Accounts</strong>
DataPath=http://mycompany/api/customers

<strong>vt__Leads</strong>
DataPath=http://mycompany/api/leads

<strong>vt__Contacts</strong>
DataPath=http://mycompany/api/contacts</pre><p>
All Virtual Tables will be listed along with Other Tables returned by your Data Source from Response.</p>
<p>&nbsp;</p>
<p><img decoding="async" class="figureimage" title="ZappySys ODBC Driver - Custom Objects" src="https://zappysys.com/onlinehelp/odbc-powerpack/scr/images/json-driver/odbc-json-driver-create-virtual-table.png" alt="ZappySys ODBC Driver - Custom Objects" /></p>
<p>&nbsp;</p>
<h3>Virtual Table &#8211; SQL Mode (v1.6 or higher)</h3>
<p>Version 1.6+ introduced new mode to create Virtual Table. Now you can write custom SQL just like a View in Relational DB.</p>
<p>See below example</p>
<p><img decoding="async" src="https://zappysys.com/onlinehelp/odbc-powerpack/scr/images/json-driver/odbc-json-driver-create-virtual-table-sqlmode.png" alt="ZappySys ODBC Driver - Custom Objects" /></p>
<h2>Virtual Table Use Cases</h2>
<p>Now lets look at a few real world use cases where Virtual Tables might be useful. You can use when your Client Application doesn&#8217;t have support to connect to ODBC in SQL Query mode and only allows Table selection / import.</p>
<h3>MS Access &#8211; Import Tables</h3>
<p>If you are using ZappySys ODBC Driver to <a href="https://zappysys.com/blog/import-rest-api-ms-access-load-json-soap-xml/" target="_blank" rel="noopener">integrate API in MS Access</a> then Virtual Tables are useful because MS Access only allows to choose Tables when you import and no place to enter custom Query.</p>
<div id="attachment_8902" style="width: 847px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2020/05/zappysys-driver-virtual-table-import-msaccess.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8902" class="size-full wp-image-8902" src="https://zappysys.com/blog/wp-content/uploads/2020/05/zappysys-driver-virtual-table-import-msaccess.png" alt="Importing Virtual Tables in MS Access (JSON REST API Example)" width="837" height="720" srcset="https://zappysys.com/blog/wp-content/uploads/2020/05/zappysys-driver-virtual-table-import-msaccess.png 837w, https://zappysys.com/blog/wp-content/uploads/2020/05/zappysys-driver-virtual-table-import-msaccess-300x258.png 300w, https://zappysys.com/blog/wp-content/uploads/2020/05/zappysys-driver-virtual-table-import-msaccess-768x661.png 768w" sizes="(max-width: 837px) 100vw, 837px" /></a><p id="caption-attachment-8902" class="wp-caption-text">Importing Virtual Tables in MS Access (JSON REST API Example)</p></div>
<h3>Informatica &#8211; Import Tables (Create Source / Target Schema from ODBC DSN)</h3>
<p>Here is another use case of <a href="https://zappysys.com/blog/read-json-informatica-import-rest-api-json-file/" target="_blank" rel="noopener">informatica rest / json api</a> integration. Informatica doesnt allow to import SQL Query structure so you must choose exposed tables. Using Virtual Tables feature you can import multiple tables from Same ODBC DSN</p>
<div id="attachment_3477" style="width: 580px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-source-json-select-table.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3477" class="size-full wp-image-3477" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-source-json-select-table.png" alt="Select JSON Source Table in Informatica Mapping Designer (JSON file or REST API)" width="570" height="335" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-source-json-select-table.png 570w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-source-json-select-table-300x176.png 300w" sizes="(max-width: 570px) 100vw, 570px" /></a><p id="caption-attachment-3477" class="wp-caption-text">Select JSON Source Table in Informatica Mapping Designer (JSON file or REST API)</p></div>
<h3>Preview Data</h3>
<p>Once virtual tables are defined you can go to preview tab and it will show entries there regardless your Data Source settings on main UI.</p>
<div id="attachment_8904" style="width: 532px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2020/05/query-virtual-table.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8904" class="size-full wp-image-8904" src="https://zappysys.com/blog/wp-content/uploads/2020/05/query-virtual-table.png" alt="Query Virtual Table - Preview Data" width="522" height="477" srcset="https://zappysys.com/blog/wp-content/uploads/2020/05/query-virtual-table.png 522w, https://zappysys.com/blog/wp-content/uploads/2020/05/query-virtual-table-300x274.png 300w" sizes="(max-width: 522px) 100vw, 522px" /></a><p id="caption-attachment-8904" class="wp-caption-text">Query Virtual Table &#8211; Preview Data</p></div>
<div class="content_block" id="custom_post_widget-8935"><h2>Troubleshooting Errors</h2>
<p>While running in Access\Excel\other and reading data from DSN created with ODBC PowerPack, if you get this error "<strong>License type [ODBC_PP_TRIAL] not found or its expired</strong>"</p>

<p>Please refer to this article for the same:  <a href="https://zappysys.zendesk.com/hc/en-us/articles/360042521533-Troubleshooting-License-type-ODBC-PP-TRIAL-not-found-or-its-expired-error-in-Microsoft-Access" target="_blank" rel="noopener">Troubleshooting "License type [ODBC_PP_TRIAL] not found or its expired" error in Microsoft Access</a></p></div>
<p>The post <a href="https://zappysys.com/blog/odbc-drivers-custom-objects-feature/">Using Custom Objects in ZappySys Drivers (Proc / View)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>POST data to API in Informatica using SQL Transformation</title>
		<link>https://zappysys.com/blog/post-data-api-informatica-using-sql-transformation/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Tue, 28 Aug 2018 04:58:26 +0000</pubDate>
				<category><![CDATA[ETL - Informatica]]></category>
		<category><![CDATA[JSON File / REST API Driver]]></category>
		<category><![CDATA[ODBC PowerPack]]></category>
		<category><![CDATA[XML File / SOAP API Driver]]></category>
		<category><![CDATA[Informatica]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[rest api]]></category>
		<category><![CDATA[soap]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=4715</guid>

					<description><![CDATA[<p>Introduction In our previous blog post we saw how to read JSON REST API / XML SOAP in Informatica using ZappySys ODBC Drivers. Now lets look at API Write scenario. We will learn how to to POST data to API in Informatica (Insert / Update). We will use SQL Transformation to fire ODBC Driver Queries [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/post-data-api-informatica-using-sql-transformation/">POST data to API in Informatica using SQL Transformation</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-powercenter-logo.png"><img loading="lazy" decoding="async" class=" wp-image-3454 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-powercenter-logo.png" alt="Informatica PowerCenter Logo" width="108" height="108" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-powercenter-logo.png 200w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-powercenter-logo-150x150.png 150w" sizes="(max-width: 108px) 100vw, 108px" /></a>In our previous blog post we saw <a href="https://zappysys.com/blog/read-json-informatica-import-rest-api-json-file/" target="_blank" rel="noopener">how to read JSON REST API / XML SOAP in Informatica</a> using ZappySys <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ODBC Drivers</a>. Now lets look at <strong>API Write scenario</strong>. We will learn how to to POST data to API in Informatica (Insert / Update). We will use <strong>SQL Transformation</strong> to fire <strong>ODBC Driver Queries</strong> to create / update or delete records in Target System by calling Web API (i.e. REST or SOAP).</p>
<p>For example purpose we will use JSON API but if you are calling XML / SOAP API then use ZappySys XML Driver instead of JSON Driver.</p>
<p>&nbsp;</p>
<h2>Requirements</h2>
<p>This article assumes that you have full filled following basic requirements.</p>
<ol>
<li>Download Install <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys ODBC PowerPack</a> (Drivers for JSON and REST API)</li>
<li>Install Informatica PowerCenter Client Tools (e.g. Workflow and Mapping Designers)</li>
<li>Access to a Relational database such as SQL Server (or use any of your choice e.g. Oracle, MySQL, DB2 ). If nothing available then you can use flat file target.</li>
</ol>
<h2>Video Tutorial &#8211; POST data to API in Informatica</h2>
<p>Here is the full Video Tutorial with many API tips / tricks to show how to POST data to REST / SOAP API in Informatica PowerCenter. It also covers how to Upload File to Web API.</p>
<a href="https://zappysys.com/blog/post-data-api-informatica-using-sql-transformation/"><img decoding="async" src="https://zappysys.com/blog/wp-content/plugins/wp-youtube-lyte/lyteCache.php?origThumbUrl=%2F%2Fi.ytimg.com%2Fvi%2FMKekE5w0rCk%2Fhqdefault.jpg" alt="YouTube Video"></a><br /><br /></p>
<p>&nbsp;</p>
<h2>Getting Started</h2>
<p>So let&#8217;s get started with basic setup on how to POST data to your API to create new records or update / delete records. In the following demo we are trying to create new Customer records by calling POST API.</p>
<p>For that we will use following setup.</p>
<h3>Create ODBC Connection for API</h3>
<p>Check <a href="https://zappysys.com/blog/read-json-informatica-import-rest-api-json-file/#Create_ODBC_DSN_using_ZappySys_JSON_Driver" target="_blank" rel="noopener">this section from previous article</a> to learn how to configure API Connection using ZappySys ODBC Driver for JSON / XML / CSV.</p>
<h3>Create Relational Connection in Workflow Designer</h3>
<p>Check <a href="https://zappysys.com/blog/read-json-informatica-import-rest-api-json-file/#Create_Connection_in_Informatica_Workflow_Designer" target="_blank" rel="noopener">this section from previous article</a> to learn how to create and configure Relational Connection of ODBC Type which points to DSN (ZappySys JSON Driver).</p>
<div id="attachment_3473" style="width: 480px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-connection-for-json-file-rest-api.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3473" class="wp-image-3473 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-connection-for-json-file-rest-api.png" alt="Configure JSON connection in Informatica for REST API / JSON File connectivity - Using ZappySys JSON ODBC Driver" width="470" height="560" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-connection-for-json-file-rest-api.png 470w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-connection-for-json-file-rest-api-252x300.png 252w" sizes="(max-width: 470px) 100vw, 470px" /></a><p id="caption-attachment-3473" class="wp-caption-text">Configure JSON connection in Informatica for REST API / JSON File connectivity &#8211; Using ZappySys JSON ODBC Driver</p></div>
<h3>Prepare POST Query and generate Metadata File</h3>
<p>Before you can call POST API in Informatica Mapping, you need to generate Metadata file using ODBC Data Source UI. Metadata file creation is important to avoid double calls (One for Metadata and One for Getting Data). When you dont Supply Metadata file to ZappySys Driver then it will try to call API twice (First time read 300 rows to guess datatypes / response columns and then call API again to read all remaining rows from response).</p>
<p>Its OK to allow two reads for the same request if its GET request (Read scenario) but its not OK if you are creating a New records because same request is sent twice and you may end up creating duplicate records.</p>
<p>Obtaining metadata is simple using Query Preview UI.</p>
<ol>
<li>Go to ODBC Data Source and setup properties on Driver UI (e.g. URL, Connection, Filter, Headers etc)</li>
<li>Once everything is configured go to Preview Tab and click Preview Button to see data.</li>
<li>Once Data is returned as per your need you can click on Save Metadata. Copy SQL Query for later use.
<div id="attachment_4716" style="width: 551px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/08/post-data-json-rest-api-using-sql-query-odbc-driver.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4716" class="size-full wp-image-4716" src="https://zappysys.com/blog/wp-content/uploads/2018/08/post-data-json-rest-api-using-sql-query-odbc-driver.png" alt="Generate Metadata File for REST API POST Operation using ZappySys API Driver (JSON / XML)" width="541" height="593" srcset="https://zappysys.com/blog/wp-content/uploads/2018/08/post-data-json-rest-api-using-sql-query-odbc-driver.png 541w, https://zappysys.com/blog/wp-content/uploads/2018/08/post-data-json-rest-api-using-sql-query-odbc-driver-274x300.png 274w" sizes="(max-width: 541px) 100vw, 541px" /></a><p id="caption-attachment-4716" class="wp-caption-text">Generate Metadata File for REST API POST Operation using ZappySys API Driver (JSON / XML)</p></div></li>
</ol>
<h3>Create Informatica Mapping to POST data to REST API / SOAP Web Service</h3>
<p>Once Metadata File is we can proceed to Informatica Mapping designer. For making instructions simple we will skip few details (e.g. Importing Source  /Target Definitions). Refer to <a href="https://zappysys.com/blog/read-json-informatica-import-rest-api-json-file/" target="_blank" rel="noopener">Previous article to read instructions in depth</a>.</p>
<p>Created Now lets look at how to read data from relational source (E.g. SQL Server, Oracle) and send data to REST API (Call POST API).</p>
<ol>
<li>Drag Source into Mapping Designer</li>
<li>Drag Expression Transform  into Mapping Designer and drop desired columns on Expression Transform as Pass through Columns.</li>
<li>Create one additional Output Port for API URL as below (You may not need this if API URL is not Dynamic. Skipping URL or any other setting in ODBC SQL Query will use DSN Settings you configured in previous section)</li>
<li>Drag SQL Transform and select following Option (Mode = Query, Connection Type =ODBC)
<div id="attachment_4717" style="width: 712px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/08/informatica-post-data-to-api-using-sql-transformation-odbc-connection.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4717" class="size-full wp-image-4717" src="https://zappysys.com/blog/wp-content/uploads/2018/08/informatica-post-data-to-api-using-sql-transformation-odbc-connection.png" alt="Create new SQL Transform for API Call (POST Data to API using Informatica and ZappySys ODBC Driver)" width="702" height="485" srcset="https://zappysys.com/blog/wp-content/uploads/2018/08/informatica-post-data-to-api-using-sql-transformation-odbc-connection.png 702w, https://zappysys.com/blog/wp-content/uploads/2018/08/informatica-post-data-to-api-using-sql-transformation-odbc-connection-300x207.png 300w" sizes="(max-width: 702px) 100vw, 702px" /></a><p id="caption-attachment-4717" class="wp-caption-text">Create new SQL Transform for API Call (POST Data to API using Informatica and ZappySys ODBC Driver)</p></div></li>
<li>Now connect input columns from Expression Transform to SQL Transformation. These input columns will be used as parameters in API POST Body and SQL Query WITH Clause to craft JSON / XML API request.</li>
<li>Now double click on SQL Transform and go to SQL Ports Tab</li>
<li>Click somewhere in the Output Columns Group and Add desired columns (Tip: Add same number of columns you define in the Metadata File in Previous section. For Demo purpose you can remove some columns from Metadata file so you have only hadful columns to deal with. When you remove columns from Metadata File make sure JSON is Valid. Many times user forget to remove last comma)</li>
<li>Once you define Input and Output columns for your SQL Transform you can Edit SQL Query button and configure your SQL Query as below. In below example query we have supplied URL,  Body, HTTP Headers. Also notice that Body JSON is crafted by using Input Columns from Upstream. We used only CustomerID as an example but in real words you may add many more in your JSON Body.<br />
<div class="su-note"  style="border-color:#e5de9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#fff8b7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><strong>For Old Version of PowerCenter- V8.5 or lower:</strong>  It&#8217;s important to Pass URL via Substitution else you may get error (http://abc.com is output as http:/abc.com &#8211; only one slash)<strong><strong>Here is a sample Query for SQL Transform (Added String Substitutions)</strong></strong> </div></div><div class="su-note"  style="border-color:#e5de9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#fff8b7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">Few things to notice:<br />
&#8211; Output Ports defined in SQL Transform must match order and column names of SQL query. Best thing is to <strong>avoid SELECT * FROM</strong> and use explicit column names like below. If you already took care column orders in Metadata file then you can use * to shorten your SQL statement.<br />
&#8211; Slash (i.e. \ ) is treated as escape character so <strong>replace slash with double slash</strong> anywhere in SQL text(e.g. c:\temp\meta.txt should be replaced with c:\\temp\\meta.txt).<br />
&#8211; If you use ? in URL (e.g. http://myapi/?id=111) then <strong>replace ? with \? </strong> because ? has special meaning in SQL Transform SQL Text.  ? is used in Parameter Binding (e.g. ?my_input_port?) .<br />
&#8211; You may use Format Specifiers <pre class="crayon-plain-tag">&lt;&lt;~P_URL~,FUN_JSONENC&gt;&gt;</pre>  if you want to encode special characters in your data (e.g. Tabs, Double quotes, New lines). <a href="https://zappysys.com/onlinehelp/odbc-powerpack/scr/odbc-format-static-placeholders.htm" target="_blank" rel="noopener">Check this link</a><br />
&#8211; Avoid using string specifier before back slash (e.g. c:\\data<strong>\\~</strong>FileName~ ). because <strong>\~</strong> cause issue with escape sequence triggered by <strong>\ </strong>. To solve this issue Use Expression Transform before SQL Transform to build Dynamic Path or other type of string.<br />
</div></div>
<pre class="crayon-plain-tag">SELECT url,origin FROM $
WITH
(
  META='c:\\temp\\meta.txt'
 ,METHOD='POST'
 ,HEADER='Content-Type:text/plain||x-hdr1:AAA'
 ,SRC='~P_URL~'
 ,BODY='
 {
    "ID": "~P_CustomerID~",
    "Link": "&lt;&lt;~P_URL~,FUN_JSONENC&gt;&gt;",
    "Notes": "Line1\\r\\nLine2"
 }'
)</pre>
<div id="attachment_4718" style="width: 1190px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/08/informatica-http-post-web-requests-call-rest-api-json-odbc-driver.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4718" class="size-full wp-image-4718" src="https://zappysys.com/blog/wp-content/uploads/2018/08/informatica-http-post-web-requests-call-rest-api-json-odbc-driver.png" alt="Configure Informatica SQL Transform to call ODBC SQL Queries - JSON /XML API POST Data (Create / Update Records)" width="1180" height="706" srcset="https://zappysys.com/blog/wp-content/uploads/2018/08/informatica-http-post-web-requests-call-rest-api-json-odbc-driver.png 1180w, https://zappysys.com/blog/wp-content/uploads/2018/08/informatica-http-post-web-requests-call-rest-api-json-odbc-driver-300x179.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/08/informatica-http-post-web-requests-call-rest-api-json-odbc-driver-768x459.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/08/informatica-http-post-web-requests-call-rest-api-json-odbc-driver-1024x613.png 1024w" sizes="(max-width: 1180px) 100vw, 1180px" /></a><p id="caption-attachment-4718" class="wp-caption-text">Configure Informatica SQL Transform to call ODBC SQL Queries &#8211; JSON /XML API POST Data (Create / Update Records)</p></div></li>
<li>In the above Screenshot Notice Following items in SQL Query.
<ol>
<li>We have specified META property (Use the same Metadata File we generated   in the previous section. Meta Property can take direct file path, meta name (settings stored in DSN) or supply direct JSON for Metadata. <strong>Notice we escaped \ with \\</strong><br />
<pre class="crayon-plain-tag">META='[ {"Name": "MyCol1", "Type": "String", "Length": 100}, {"Name": "MyCol2", "Type": "String", "Length": 100} ...... ]'
-- OR --
META='c:\\meta\\my_post_query_metadata.txt'
-- OR --
META='MyMetaName'</pre>
</li>
<li>Second thing you will Notice that in the Body we have used <strong>String Substitution</strong> in <strong>SRC</strong> and <strong>BODY</strong>.  If your URL is not Dynamic and you like to use setting defined in DSN then omit SRC attribute from WITH clause. Substitution must start and end with tild (~). For example Input column P_URL can be used as <strong>~P_URL~</strong> and at runtime it will be replaced. Make sure to <strong>escape  single quote with double quote (We replaced &#8216; with &#8221; in Sam&#8221;s)</strong> in Input Parameter Values else SQL Query will fail. You can use Expression Transform to escape data if needed using REPLACE function.  <strong>We also replaced \r\n with \\r\\n</strong><br />
<pre class="crayon-plain-tag">SRC='~P_URL~'</pre>
and<br />
<pre class="crayon-plain-tag">BODY='
 {
    "ID": "~P_CustomerID~",
    "Notes": "Line1\\r\\nLine2, Sam''s Club"
 }'</pre>
</li>
</ol>
</li>
<li>Now connect your SQL Transformation output Ports to Target (e.g. Flat File Target or Relational Target)</li>
<li>Create new Workflow and Session using this Mapping</li>
<li>Go to Session properties and on the Mapping Tab make sure to change COnnection Type for SQL Transformation to Relational Connection.
<div id="attachment_4719" style="width: 964px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/08/configure-informatica-session-for-rest-api-post-use-odbc-connection.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4719" class="size-full wp-image-4719" src="https://zappysys.com/blog/wp-content/uploads/2018/08/configure-informatica-session-for-rest-api-post-use-odbc-connection.png" alt="Configure Session Mapping Properties - Set ODBC COnnection Type for SQL Transform to call API requests" width="954" height="723" srcset="https://zappysys.com/blog/wp-content/uploads/2018/08/configure-informatica-session-for-rest-api-post-use-odbc-connection.png 954w, https://zappysys.com/blog/wp-content/uploads/2018/08/configure-informatica-session-for-rest-api-post-use-odbc-connection-300x227.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/08/configure-informatica-session-for-rest-api-post-use-odbc-connection-768x582.png 768w" sizes="(max-width: 954px) 100vw, 954px" /></a><p id="caption-attachment-4719" class="wp-caption-text">Configure Session Mapping Properties &#8211; Set ODBC COnnection Type for SQL Transform to call API requests</p></div></li>
<li>In our example we changed Target to File Writer but you can save SQL Transform output to some relational table too.</li>
<li>Now you can execute Workflow and check your session log for any error. You can also debug <a href="https://zappysys.com/blog/how-to-use-fiddler-to-analyze-http-web-requests/" target="_blank" rel="noopener">web requests in Fiddler</a> (Must be installed on Server where actual Job is running).
<div id="attachment_4720" style="width: 1079px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/08/informatica-execution-log-check-api-post-requests-in-fiddler.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4720" class="size-full wp-image-4720" src="https://zappysys.com/blog/wp-content/uploads/2018/08/informatica-execution-log-check-api-post-requests-in-fiddler.png" alt="Monitor Session Execution in Informatica - Debug Web API requests using Fiddler" width="1069" height="780" srcset="https://zappysys.com/blog/wp-content/uploads/2018/08/informatica-execution-log-check-api-post-requests-in-fiddler.png 1069w, https://zappysys.com/blog/wp-content/uploads/2018/08/informatica-execution-log-check-api-post-requests-in-fiddler-300x219.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/08/informatica-execution-log-check-api-post-requests-in-fiddler-768x560.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/08/informatica-execution-log-check-api-post-requests-in-fiddler-1024x747.png 1024w" sizes="(max-width: 1069px) 100vw, 1069px" /></a><p id="caption-attachment-4720" class="wp-caption-text">Monitor Session Execution in Informatica &#8211; Debug Web API requests using Fiddler</p></div></li>
</ol>
<h2>Upload File to API (Read Body from Local File)</h2>
<p>Now let&#8217;s look at scenario to POST Body content from File (i.e. Upload File to API). Below simple query will Upload file content to API server (POST request where Body is coming from file)</p><pre class="crayon-plain-tag">SELECT url,origin FROM $
WITH
(
  META='c:\\temp\\meta.txt'
 ,METHOD='POST'
 ,HEADER='Content-Type:text/plain||x-hdr1:AAA'
 ,SRC='~P_URL~'
 ,BODY='@~P_FilePath~'
 ,IsMultiPart='True'
)</pre><p>
Notice how we have used <strong>IsMultiPart = &#8216;True&#8217;</strong>  and <strong>used @ before FilePath</strong> in Body. Our File Path is coming from String Substitution (i.e. Input Port  <strong>~P_FilePath~</strong>)</p>
<h2>Debugging REST / SOAP API using Fiddler</h2>
<p>Check <a href="https://zappysys.com/blog/how-to-use-fiddler-to-analyze-http-web-requests/" target="_blank" rel="noopener">this article</a> on how to debug REST / SOAP API calls using fiddler. You can also <a href="https://zappysys.zendesk.com/hc/en-us/articles/360017594154-How-to-enable-Logging-for-ODBC-PowerPack" target="_blank" rel="noopener">enable <strong>Log</strong> to <strong>Debug Mode</strong> on <strong>Advanced Tab</strong></a> of ODBC DSN UI.</p>
<h2>Conclusion</h2>
<p>In this post we saw how to call API POST requests in Informatica and send data from relational system to Web API (Create / Update / Delete Records using JSON / XML API calls). You can explore many other API related scenarios using <strong>ZappySys ODBC Drives for JSON / XML / CSV</strong>. <a href="https://zappysys.com/products/odbc-powerpack/">Click here to try ZappySys ODBC Drivers for FREE</a> and check out how easy it is to read / write JSON / XML API in Informatica or any other ODBC Compliant Apps (e.g Power BI, SSIS, Qlik).</p>
<p>&nbsp;</p>
<p>The post <a href="https://zappysys.com/blog/post-data-api-informatica-using-sql-transformation/">POST data to API in Informatica using SQL Transformation</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Read JSON in Informatica &#8211; Import REST API / SOAP / JSON File</title>
		<link>https://zappysys.com/blog/read-json-informatica-import-rest-api-json-file/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Tue, 08 May 2018 21:01:37 +0000</pubDate>
				<category><![CDATA[ETL - Informatica]]></category>
		<category><![CDATA[JSON File / REST API Driver]]></category>
		<category><![CDATA[ODBC PowerPack]]></category>
		<category><![CDATA[XML File / SOAP API Driver]]></category>
		<category><![CDATA[etl]]></category>
		<category><![CDATA[Informatica]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[odbc]]></category>
		<category><![CDATA[rest api]]></category>
		<category><![CDATA[xml]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=3450</guid>

					<description><![CDATA[<p>Introduction JSON / REST API is becoming more and more popular each day as everyone embrace cloud-centric services. This article is primarily focused on Informatica users who want to do XML SOAP/ JSON / REST API Integration in Informatica. However many tips and techniques described in this article will help you to understand how to integrate XML [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/read-json-informatica-import-rest-api-json-file/">Read JSON in Informatica &#8211; Import REST API / SOAP / JSON File</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-powercenter-logo.png"><img loading="lazy" decoding="async" class=" wp-image-3454 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-powercenter-logo.png" alt="Informatica PowerCenter Logo" width="108" height="108" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-powercenter-logo.png 200w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-powercenter-logo-150x150.png 150w" sizes="(max-width: 108px) 100vw, 108px" /></a>JSON / REST API is becoming more and more popular each day as everyone embrace cloud-centric services. This article is primarily focused on Informatica users who want to do <strong>XML SOAP/ JSON / REST API Integration in Informatica</strong>. However many tips and techniques described in this article will help you to understand how to integrate XML SOAP / JSON / REST API in other ETL / Reporting apps such as Tableau, Power BI, SSRS, Talend, Excel and many more.</p>
<p>After going through this article you will learn <strong>how to Read JSON in Informatica </strong>and understand the <strong>concept of JSON / REST API</strong>. We will go through many screenshots and step-by-step examples to demonstrate  <strong>JSON File or REST API integration in Informatica PowerCenter.</strong></p>
<p>XML / JSON can come from a local file or REST API service (internal or public) so we will include both examples in this article (i.e. Read JSON files in Informatica,  Import REST API in Informatica). So let&#8217;s get started. Next article will focus on <a href="https://zappysys.com/blog/post-data-api-informatica-using-sql-transformation/" target="_blank" rel="noopener">how to write data to API in Informatica (POST / PUT data)</a></p>
<h2>Requirements</h2>
<p>This article assumes that you have full filled following basic requirements.</p>
<ol>
<li>Download Install <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys ODBC PowerPack</a> (Drivers for JSON and REST API)</li>
<li>Install Informatica PowerCenter Client Tools (e.g. Workflow and Mapping Designers)</li>
<li>Access to a Relational database such as SQL Server (or use any of your choice e.g. Oracle, MySQL, DB2 ). If nothing available then you can use flat file target.</li>
</ol>
<h2>How to Import JSON data using Informatica (Read JSON Files or REST API)</h2>
<p>Before we dive deep to learn how to load JSON data in Informatica (JSON to SQL Table), Here the summary of high-level steps you need to perform to import JSON Files or REST API in Informatica.</p>
<ol>
<li>Download and Install <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys JSON ODBC Driver</a> (for JSON Files and REST API)</li>
<li>Create ODBC DSN using ZappySys JSON driver for your API Service (You can override most of the DSN settings via SQL Query at runtime)</li>
<li>Create Relational &gt; <strong>ODBC</strong> Connection in <strong>Informatica Workflow designer</strong> (Point to JSON DSN we created in the previous step)</li>
<li>Import JSON Source Definition in the <strong>Informatica Mapping Designer</strong> &gt; <strong>Sources Tab</strong></li>
<li>Import Target Table Definition in the <strong>Informatica Mapping Designer</strong> &gt; <strong>Targets Tab</strong></li>
<li>Create source to target mapping in Mappings tab</li>
<li>Save mapping (name <strong>m_API_to_SQL_Load</strong> )</li>
<li>Create Session using the mapping we created in the previous step</li>
<li>Save Workflow and execute to load JSON data into SQL Table. Verify your data and log.
<div id="attachment_3475" style="width: 730px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-execution-log-json-to-sql-import.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3475" class="wp-image-3475 size-medium_large" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-execution-log-json-to-sql-import-768x379.png" alt="Loading JSON data to SQL Table in Informatica (Import REST API or JSON Files)" width="720" height="355" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-execution-log-json-to-sql-import-768x379.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-execution-log-json-to-sql-import-300x148.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-execution-log-json-to-sql-import-1024x505.png 1024w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-execution-log-json-to-sql-import.png 1164w" sizes="(max-width: 720px) 100vw, 720px" /></a><p id="caption-attachment-3475" class="wp-caption-text">Loading JSON data to SQL Table in Informatica (Import REST API or JSON Files)</p></div></li>
</ol>
<h2>Video Tutorial &#8211; Read JSON in Informatica (Load JSON to SQL Table)</h2>
<p>By watching following ~5 min video can learn steps listed in this article to load JSON API data into SQL Server Table using <strong>ZappySys JSON Driver</strong>. You can go though full article to learn many useful details not covered in this video.</p>
<a href="https://zappysys.com/blog/read-json-informatica-import-rest-api-json-file/"><img decoding="async" src="https://zappysys.com/blog/wp-content/plugins/wp-youtube-lyte/lyteCache.php?origThumbUrl=%2F%2Fi.ytimg.com%2Fvi%2FTaKp9Tewbr0%2Fhqdefault.jpg" alt="YouTube Video"></a><br /><br /></p>
<h2>Getting Started &#8211; Import JSON to SQL Server in Informatica</h2>
<p>Now let&#8217;s get started. For example purpose, we will read data from OData JSON based REST API service and load data into SQL Server Table using Informatica Workflow.</p>
<h3>Create ODBC DSN using ZappySys JSON Driver</h3>
<p>The first step to read from JSON File or REST API Service in Informatica is to create ODBC DSN.</p>
<ol>
<li>Search for ODBC in your start menu and open <strong>ODBC Data Sources (64bit)</strong>. You can also find same under ZappySys &gt; ODBC PowerPack &gt; ODBC Data Sources (64bit)</li>
<li>When ODBC UI shows up, Go to System tab.</li>
<li>Click on <strong>Add</strong></li>
<li>Select <strong>ZappySys JSON Driver</strong> from the list and click Finish.
<div id="attachment_3457" style="width: 578px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/create-odbc-dsn-for-informatica-json-file-rest-api-connection.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3457" class="size-full wp-image-3457" src="https://zappysys.com/blog/wp-content/uploads/2018/05/create-odbc-dsn-for-informatica-json-file-rest-api-connection.png" alt="Create New DSN for JSON File or REST API - Use ZappySys JSON Driver" width="568" height="504" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/create-odbc-dsn-for-informatica-json-file-rest-api-connection.png 568w, https://zappysys.com/blog/wp-content/uploads/2018/05/create-odbc-dsn-for-informatica-json-file-rest-api-connection-300x266.png 300w" sizes="(max-width: 568px) 100vw, 568px" /></a><p id="caption-attachment-3457" class="wp-caption-text">Create New DSN for JSON File or REST API &#8211; Use ZappySys JSON Driver</p></div></li>
<li>When Configuration UI enter the following URL for Data source. You can also enter JSON File path here too but for this example, we will use OData REST API (JSON Format). Click Test to confirm its working. This API doesn&#8217;t use any credentials but in the real world, you may have credentials (e.g. OAuth creds using Key / Secret or Basic Auth using UserID / Password). Below URL is default URL for your DSN. You can always override URL and other settings from SQL Query using WITH Clause (<a href="https://zappysys.com/onlinehelp/odbc-powerpack/scr/json-odbc-driver-sql-query-examples.htm" target="_blank" rel="noopener">see examples</a>)<br />
<pre class="crayon-plain-tag">https://services.odata.org/V3/Northwind/Northwind.svc/Invoices?$format=json</pre>
<div id="attachment_3458" style="width: 724px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-json-odbc-dsn.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3458" class="wp-image-3458 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-json-odbc-dsn.png" alt="Configure ODBC DSN - Import JSON in Informatica (REST API or JSON Files)" width="714" height="742" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-json-odbc-dsn.png 714w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-json-odbc-dsn-289x300.png 289w" sizes="(max-width: 714px) 100vw, 714px" /></a><p id="caption-attachment-3458" class="wp-caption-text">Configure ODBC DSN for JSON Data</p></div></li>
<li>Optionally one more setting you can change is Under <strong>Other settings</strong> &gt;&gt;&gt;  <strong>Date data type</strong> set option to <strong>Convert to DateTime (Timezone lost)</strong>. If you don&#8217;t do this then OrderDate field or any other Date Field will be detected as nstring in Informatica. Later in this section, we will show you how to convert nstring to DateTime using Expression Transform (TO_DATE function).</li>
<li>Now switch to Preview Tab and try some sample queries to learn more about API driver. For example, you can try some with simple queries like below. For more advanced queries <a href="https://zappysys.com/onlinehelp/odbc-powerpack/scr/json-odbc-driver-sql-query-examples.htm" target="_blank" rel="noopener">read this help file</a>.<strong>Read from root level (include all attributes)</strong><br />
<pre class="crayon-plain-tag">select * from $</pre>
<strong>Read from an array (value tag)</strong><br />
<pre class="crayon-plain-tag">select * from value
--OR--
select * from $ WITH (Filter='$.value[*]')</pre>
<strong>Override URL (Supply different URL than entered in ODBC DSN UI)</strong><br />
<pre class="crayon-plain-tag">SELECT * FROM $
WITH (SRC='https://api.hubapi.com/contacts/v1/lists/all/contacts/all?hapikey=demo&amp;count=20', 
Filter='$.contacts[*]')</pre>
</li>
<li>Click on <strong>View Examples</strong> to check other example queries
<div id="attachment_3469" style="width: 696px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-json-rest-api-query-examples.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3469" class="size-full wp-image-3469" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-json-rest-api-query-examples.png" alt="ODBC JSON Driver Query Preview - Informatica JSON Query Examples (Read REST API or JSON Files)" width="686" height="789" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-json-rest-api-query-examples.png 686w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-json-rest-api-query-examples-261x300.png 261w" sizes="(max-width: 686px) 100vw, 686px" /></a><p id="caption-attachment-3469" class="wp-caption-text">ODBC JSON Driver Query Preview &#8211; Informatica JSON Query Examples (Read REST API or JSON Files)</p></div></li>
<li>Click OK to save your DSN Properties.</li>
<li>Click OK to close ODBC Data SOurces UI.</li>
</ol>
<h3>Create Connection in Informatica Workflow Designer</h3>
<p>Once you create DSN using JSON Driver our next step is to define a connection for JSON source in Informatica PowerCenter Workflow designer.</p>
<ol>
<li>Open Workflow designer [W] icon</li>
<li>Goto <strong>Connections</strong> &gt; <strong>Relational</strong>
<div id="attachment_3471" style="width: 342px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-designer-create-connection-for-json-file-rest-api.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3471" class="size-full wp-image-3471" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-designer-create-connection-for-json-file-rest-api.png" alt="Create new connection for JSON in Informatica" width="332" height="182" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-designer-create-connection-for-json-file-rest-api.png 332w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-designer-create-connection-for-json-file-rest-api-300x164.png 300w" sizes="(max-width: 332px) 100vw, 332px" /></a><p id="caption-attachment-3471" class="wp-caption-text">Create a new connection for JSON in Informatica</p></div></li>
<li>Click <strong>New</strong> and select ODBC
<div id="attachment_3472" style="width: 424px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-powercenter-create-odbc-connection-json-file-rest-api.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3472" class="size-full wp-image-3472" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-powercenter-create-odbc-connection-json-file-rest-api.png" alt="Select ODBC connection type in Informatica (Using ZappySys JSON ODBC DSN)" width="414" height="478" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-powercenter-create-odbc-connection-json-file-rest-api.png 414w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-powercenter-create-odbc-connection-json-file-rest-api-260x300.png 260w" sizes="(max-width: 414px) 100vw, 414px" /></a><p id="caption-attachment-3472" class="wp-caption-text">Select ODBC connection type in Informatica (Using ZappySys JSON ODBC DSN)</p></div></li>
<li>Now on the ODBC connection setup enter connection name, some <strong>fake userid / password</strong> (this is a required field but its ignored by JSON Driver)</li>
<li>In the <strong>Connection String</strong> field enter the exact same name of DSN (Open ODBC Data Sources UI to confirm)
<div id="attachment_3473" style="width: 480px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-connection-for-json-file-rest-api.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3473" class="size-full wp-image-3473" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-connection-for-json-file-rest-api.png" alt="Configure JSON connection in Informatica for REST API / JSON File connectivity - Using ZappySys JSON ODBC Driver" width="470" height="560" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-connection-for-json-file-rest-api.png 470w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-connection-for-json-file-rest-api-252x300.png 252w" sizes="(max-width: 470px) 100vw, 470px" /></a><p id="caption-attachment-3473" class="wp-caption-text">Configure JSON connection in Informatica for REST API<br />/ JSON File connectivity &#8211; Using ZappySys JSON ODBC Driver</p></div></li>
<li>Click OK to close the connection properties.</li>
</ol>
<p>That&#8217;s it. Now we ready to move to next step (define source and target in Mapping Designer).</p>
<h3>Import JSON Source Definition in Informatica Mapping Designer</h3>
<p>Now let&#8217;s look at steps to import JSON source table definition.</p>
<ol>
<li>Open Informatica Mapping Designer (Click [D] icon)</li>
<li>Click on Source Icon to switch to Sources designer</li>
<li>From the <strong>top menu</strong> &gt; Click on <strong>Sources</strong> &gt; <strong>Import from Database</strong> &#8230;
<div id="attachment_3476" style="width: 533px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-json-source-definition.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3476" class="size-full wp-image-3476" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-json-source-definition.png" alt="Import JSON Source definition in Informatica Mapping Designer (JSON file or REST API)" width="523" height="224" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-json-source-definition.png 523w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-json-source-definition-300x128.png 300w" sizes="(max-width: 523px) 100vw, 523px" /></a><p id="caption-attachment-3476" class="wp-caption-text">Import JSON Source definition in Informatica Mapping Designer (JSON file or REST API)</p></div></li>
<li>Select ODBC data source from the dropdown (Find out DSN we created earlier to use as JSON Source)</li>
<li>Click Connect button to get a list of tables. Any array node is listed as a table. Also, you will see array node with parent columns (e.g. value_with_parent). You may get some warning like below but they are harmless so just ignore by clicking OK.<br />
<div class="su-note"  style="border-color:#e5dd9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#FFF7B7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">DLL name entry missing from C:\Informatica\PowerCenter8.6.1\client\bin\powrmart.ini Section = ODBCDLL Entry = ZappySys JSON Driver<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Using EXTODBC.DLL to support ZappySys JSON Driver. For native support of ZappySys JSON Driver make an entry in the .ini file.</div></div>
<div id="attachment_3477" style="width: 580px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-source-json-select-table.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3477" class="size-full wp-image-3477" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-source-json-select-table.png" alt="Select JSON Source Table in Informatica Mapping Designer (JSON file or REST API)" width="570" height="335" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-source-json-select-table.png 570w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-source-json-select-table-300x176.png 300w" sizes="(max-width: 570px) 100vw, 570px" /></a><p id="caption-attachment-3477" class="wp-caption-text">Select JSON Source Table in Informatica Mapping Designer (JSON file or REST API)</p></div></li>
<li>Select Table you wish to get (You can filter rows by custom SQL query. We will see later in this article how to do)</li>
<li>Optionally once table structure is imported you can rename it
<div id="attachment_3478" style="width: 606px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-rename-source-table-name.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3478" class="size-full wp-image-3478" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-rename-source-table-name.png" alt="Rename imported table definition in Informatica Source Designer" width="596" height="431" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-rename-source-table-name.png 596w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-rename-source-table-name-300x217.png 300w" sizes="(max-width: 596px) 100vw, 596px" /></a><p id="caption-attachment-3478" class="wp-caption-text">Rename imported table definition in Informatica Source Designer</p></div></li>
<li>That&#8217;s it, we are now ready to perform similar steps to import Target table structure in the next section.</li>
</ol>
<h3>Import SQL Server Target Definition in Informatica Mapping Designer</h3>
<p>Now let&#8217;s look at steps to import Target table definition (very similar to the previous section, the only difference is this time we will select DSN which points to SQL Server or any other Target Server). For example purpose, we will use following table structure as our SQL Server Table. If its missing you can create one.</p><pre class="crayon-plain-tag">CREATE TABLE [dbo].[Tbl_Invoices](
	[ShipName] [nvarchar](40) NULL,
	[ShipAddress] [nvarchar](60) NULL,
	[ShipCity] [nvarchar](15) NULL,
	[ShipRegion] [nvarchar](15) NULL,
	[ShipPostalCode] [nvarchar](10) NULL,
	[ShipCountry] [nvarchar](15) NULL,
	[CustomerID] [nchar](5) NULL,
	[CustomerName] [nvarchar](40) NULL,
	[Address] [nvarchar](60) NULL,
	[City] [nvarchar](15) NULL,
	[Region] [nvarchar](15) NULL,
	[PostalCode] [nvarchar](10) NULL,
	[Country] [nvarchar](15) NULL,
	[Salesperson] [nvarchar](31) NULL,
	[OrderID] [int] NULL,
	[OrderDate] [datetime] NULL,
	[RequiredDate] [datetime] NULL,
	[ShippedDate] [datetime] NULL,
	[ShipperName] [nvarchar](40) NULL,
	[ProductID] [int] NULL,
	[ProductName] [nvarchar](40) NULL,
	[UnitPrice] [money] NULL,
	[Quantity] [smallint] NULL,
	[Discount] [real] NULL,
	[ExtendedPrice] [money] NULL,
	[Freight] [money] NULL
)</pre><p>
Now lets look at steps to import target table definition in Informatica mapping designer.</p>
<ol>
<li>In the Mapping Designer, Click on Target Icon to switch to Target designer</li>
<li>From the <strong>top menu</strong> &gt; Click on <b>Targets </b>&gt; <strong>Import from Database</strong> &#8230;</li>
<li>Select DSN for your Target server (if DSN doesn&#8217;t exist then create one by opening ODBC Sources just like we created one for JSON API source (see the previous section about creating DSN).
<div id="attachment_3480" style="width: 535px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-sql-server-target-definition.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3480" class="size-full wp-image-3480" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-sql-server-target-definition.png" alt="Import target Table Definition in informatica" width="525" height="224" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-sql-server-target-definition.png 525w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-sql-server-target-definition-300x128.png 300w" sizes="(max-width: 525px) 100vw, 525px" /></a><p id="caption-attachment-3480" class="wp-caption-text">Import target Table Definition in informatica</p></div></li>
<li>Enter your userid , password and Schema name and click Connect to see tables</li>
<li>Select Table name to and click OK import definition.
<div id="attachment_3479" style="width: 579px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-sql-server-target-definition-select-table.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3479" class="size-full wp-image-3479" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-sql-server-target-definition-select-table.png" alt="Import Target SQL Table Definition in Informatica - Select table from the list" width="569" height="386" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-sql-server-target-definition-select-table.png 569w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-sql-server-target-definition-select-table-300x204.png 300w" sizes="(max-width: 569px) 100vw, 569px" /></a><p id="caption-attachment-3479" class="wp-caption-text">Import Target SQL Table Definition in Informatica &#8211; Select table from the list</p></div></li>
</ol>
<h3>Create Source to Target Mapping in Informatica (Import JSON to SQL Server)</h3>
<p>Once you have imported source and target table definition, we can create mapping and transformation to load data from JSON to SQL Table.</p>
<ol>
<li>First open Mapping Designer (Click [D] icon)</li>
<li>Drag JSON Source from sources folder</li>
<li>Drag SQL Table from Targets folder</li>
<li>Map desired columns from Source to target
<div id="attachment_3482" style="width: 1136px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-json-to-sql-server-data-load-mapping-rest-api-json-file.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3482" class="size-full wp-image-3482" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-json-to-sql-server-data-load-mapping-rest-api-json-file.png" alt="Define Source to Target mapping for JSON to SQL Table load in Informatica" width="1126" height="565" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-json-to-sql-server-data-load-mapping-rest-api-json-file.png 1126w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-json-to-sql-server-data-load-mapping-rest-api-json-file-300x151.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-json-to-sql-server-data-load-mapping-rest-api-json-file-768x385.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-json-to-sql-server-data-load-mapping-rest-api-json-file-1024x514.png 1024w" sizes="(max-width: 1126px) 100vw, 1126px" /></a><p id="caption-attachment-3482" class="wp-caption-text">Define Source to Target mapping for JSON to SQL Table load in Informatica</p></div></li>
<li>For certain columns you may have to do datatype conversion. For example to convert OrderDate form nstring to DataTime you have to use Expression Transform like below and map it to target. In below example, our JSON has date format (e.g. <strong>2018-01-31 12:00:00 AM</strong> ). To import this to DateTime field in SQL server we need to convert it using TO_DATE function. Use double quotes around T to make this format working.<br />
<pre class="crayon-plain-tag">TO_DATE(OrderDate,'YYYY-MM-DD H12:MI:SS AM')

--For ISO use below way
TO_DATE(OrderDate,'YYYY-MM-DD"T"HH24:MI:SS')</pre>
<div id="attachment_3481" style="width: 1037px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-json-to-sql-datetime-convert-iso-format.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3481" class="size-full wp-image-3481" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-json-to-sql-datetime-convert-iso-format.png" alt="Informatica JSON to SQL Table Mapping - Datatype conversion (nstring to datetime) " width="1027" height="508" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-json-to-sql-datetime-convert-iso-format.png 1027w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-json-to-sql-datetime-convert-iso-format-300x148.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-json-to-sql-datetime-convert-iso-format-768x380.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-json-to-sql-datetime-convert-iso-format-1024x507.png 1024w" sizes="(max-width: 1027px) 100vw, 1027px" /></a><p id="caption-attachment-3481" class="wp-caption-text">Informatica JSON to SQL Table Mapping &#8211; Datatype conversion (nstring to datetime)</p></div></li>
<li>Once you done with mapping save your mapping and name it (i.e. m_Api_To_SQL)</li>
<li>Now lets move to next section to create workflow.</li>
</ol>
<h3>Create Workflow and Session in Informatica</h3>
<p>Now the final step is to create a new workflow. Perform following steps to create workflow which with a session task to import JSON data into SQL table.</p>
<ol>
<li>Open workflow designer by click [W] icon.</li>
<li>Launch new workflow creation wizard by <strong>click Workflow top menu</strong> &gt;  <strong>Wizard</strong><br />
name your workflow (e.g. wf_Api_Tp_Sql_Table_Import)</p>
<div id="attachment_3484" style="width: 662px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-workflow-import-json-api-to-sql-table-wizard.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3484" class="size-full wp-image-3484" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-workflow-import-json-api-to-sql-table-wizard.png" alt="Creating Informatica Workflow - Wizard UI (Import JSON data to SQL Table)" width="652" height="516" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-workflow-import-json-api-to-sql-table-wizard.png 652w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-workflow-import-json-api-to-sql-table-wizard-300x237.png 300w" sizes="(max-width: 652px) 100vw, 652px" /></a><p id="caption-attachment-3484" class="wp-caption-text">Creating Informatica Workflow &#8211; Wizard UI (Import JSON data to SQL Table)</p></div></li>
<li>Finish the wizard and double-click the Session to edit some default properties.</li>
<li>First change Error settings so we fail session on error (By default its always green)
<div id="attachment_3485" style="width: 404px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-session-stop-on-error.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3485" class="size-full wp-image-3485" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-session-stop-on-error.png" alt="Fail Informatica Session on error (JSON to SQL Load)" width="394" height="381" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-session-stop-on-error.png 394w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-session-stop-on-error-300x290.png 300w" sizes="(max-width: 394px) 100vw, 394px" /></a><p id="caption-attachment-3485" class="wp-caption-text">Fail Informatica Session on error (JSON to SQL Load)</p></div></li>
<li>Select JSON connection for Source
<div id="attachment_3486" style="width: 740px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-create-workflow-session-configure-json-connection.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3486" class="size-full wp-image-3486" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-create-workflow-session-configure-json-connection.png" alt="Select JSON Source Connection in Informatica - JSON File / REST API Load to SQL Table" width="730" height="661" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-create-workflow-session-configure-json-connection.png 730w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-create-workflow-session-configure-json-connection-300x272.png 300w" sizes="(max-width: 730px) 100vw, 730px" /></a><p id="caption-attachment-3486" class="wp-caption-text">Select JSON Source Connection in Informatica &#8211; JSON File / REST API Load to SQL Table</p></div></li>
<li>Change default Source query if needed. You can pass parameters to this query to make it dynamic.
<div id="attachment_3487" style="width: 746px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-call-rest-api-pass-parameters-runtime-dynamic-sql.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3487" class="size-full wp-image-3487" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-call-rest-api-pass-parameters-runtime-dynamic-sql.png" alt="Modify JSON Source SQL query - Pass parameters, change URL, set filter etc" width="736" height="712" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-call-rest-api-pass-parameters-runtime-dynamic-sql.png 736w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-call-rest-api-pass-parameters-runtime-dynamic-sql-300x290.png 300w" sizes="(max-width: 736px) 100vw, 736px" /></a><p id="caption-attachment-3487" class="wp-caption-text">Modify JSON Source SQL query &#8211; Pass parameters, change URL, set filter etc</p></div></li>
<li>Select Target connection of SQL Target Table
<div id="attachment_3488" style="width: 830px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-create-workflow-session-configure-sql-target-connection.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3488" class="size-full wp-image-3488" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-create-workflow-session-configure-sql-target-connection.png" alt="Select SQL Target Connection in Informatica - JSON File / REST API Load to SQL Table" width="820" height="647" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-create-workflow-session-configure-sql-target-connection.png 820w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-create-workflow-session-configure-sql-target-connection-300x237.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-create-workflow-session-configure-sql-target-connection-768x606.png 768w" sizes="(max-width: 820px) 100vw, 820px" /></a><p id="caption-attachment-3488" class="wp-caption-text">Select SQL Target Connection in Informatica &#8211; JSON File / REST API Load to SQL Table</p></div></li>
<li>Save workflow</li>
<li>That&#8217;s it. We ready to run our first workflow to load JSON data to SQL.</li>
</ol>
<h3>Execute Workflow and Validate Log in Informatica</h3>
<p>Now once you are done with your workflow, execute it to see the log.</p>
<div id="attachment_3475" style="width: 1174px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-execution-log-json-to-sql-import.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3475" class="size-full wp-image-3475" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-execution-log-json-to-sql-import.png" alt="Loading JSON data to SQL Table in Informatica (Import REST API or JSON Files)" width="1164" height="574" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-execution-log-json-to-sql-import.png 1164w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-execution-log-json-to-sql-import-300x148.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-execution-log-json-to-sql-import-768x379.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-execution-log-json-to-sql-import-1024x505.png 1024w" sizes="(max-width: 1164px) 100vw, 1164px" /></a><p id="caption-attachment-3475" class="wp-caption-text">Loading JSON data to SQL Table in Informatica (Import REST API or JSON Files)</p></div>
<p>&nbsp;</p>
<h2>Import JSON Files in Informatica (Single or multiple)</h2>
<p>So far we have seen an example of loading JSON REST API in Informatica but loading JSON files are pretty much same process. Rather than URL, you have to specify JSON file path as Data source.</p>
<p>ZappySys JSON Driver is capable of reading from JSON file, REST API, and embedded JSON string.</p>
<p><strong>Reading JSON data from single File Informatica</strong></p>
<p>select * from $ (SRC=&#8217;c:\data\customer_2015.json&#8217;, Filter=&#8217;$.rows[*]&#8217;)</p>
<p><strong>Reading JSON data from multiple Files in Informatica</strong></p>
<p>select * from $ (SRC=&#8217;c:\data\customer_*.json&#8217;, Filter=&#8217;$.rows[*]&#8217;)</p>
<p><strong>Reading JSON data from embedded string</strong></p><pre class="crayon-plain-tag">SELECT * FROM $ 
WITH 
(
Filter='$.rows[*]',
DATA='
{          
  rows : [
        {id:1, name: "AAA"}, 
        {id:2, name: "BBB"}, 
        {id:3, name: "CCC"}
  ]
}'
)</pre><p>
&nbsp;</p>
<h2>Import XML Files in Informatica</h2>
<p>Reading from XML files or API can be done using the same way as previous sections except you have to use ZappySys XML Driver. Read help file here to <a href="https://zappysys.com/onlinehelp/odbc-powerpack/scr/xml-odbc-driver-sql-query-examples.htm" target="_blank" rel="noopener">see examples</a>.</p>
<h2>POST data to REST API in Informatica</h2>
<p>There will be a time when you like to send Source data to REST API or SOAP Web Service. You can use below Query for example. For detailed explanation on how to <a href="https://zappysys.com/blog/post-data-api-informatica-using-sql-transformation/" target="_blank" rel="noopener">POST data in Informatica check this article</a>.</p><pre class="crayon-plain-tag">SELECT * FROM $
WITH 
(METHOD='POST' 
,HEADER='Content-Type:text/plain || x-hdr1:AAA'
,SRC='http://httpbin.org/post'
,BODY='{ data of body goes here }'
)</pre><p>
<h3>Video Tutorial &#8211; How to POST data to REST API in Informatica</h3>
<p>Here is detailed step by step video on REST API POST in informatica PowerCenter</p>
<a href="https://zappysys.com/blog/read-json-informatica-import-rest-api-json-file/"><img decoding="async" src="https://zappysys.com/blog/wp-content/plugins/wp-youtube-lyte/lyteCache.php?origThumbUrl=%2F%2Fi.ytimg.com%2Fvi%2FMKekE5w0rCk%2Fhqdefault.jpg" alt="YouTube Video"></a><br /><br /></p>
<p>&nbsp;</p>
<h2>Upload file to REST API in Informatica</h2>
<p>Above example was POST data to API URL but what if your Request Body is large and you have saved that to file? Well here is the way to get your request body from a file (Use @ symbol before path and add IsMultiPart=&#8217;True&#8217;). Refer to this post to <a href="https://zappysys.com/blog/rest-api-file-upload-using-ssis-multi-part-post/" target="_blank" rel="noopener">learn more about Raw Upload and Multi-Part Upload</a></p><pre class="crayon-plain-tag">SELECT * FROM $
WITH 
(METHOD='POST' 
,HEADER='Content-Type:text/plain || x-hdr1:AAA'
,SRC='http://httpbin.org/post'
,BODY='@c:\files\dump.xml'
,IsMultiPart='True'
)</pre><p>
<h2>Calling XML SOAP Web Service in Informatica</h2>
<p>So far we have looked at examples to consume data using JSON driver. Now lets look at an example, to call XML SOAP Web Service in Informatica.</p>
<div class="content_block" id="custom_post_widget-3870">To call SOAP API you need to know Request XML Body Structure. If you are not sure how to create SOAP Request body then no worries. <a href="https://zappysys.com/blog/calling-soap-web-service-in-ssis-xml-source/" target="_blank" rel="noopener">Check this article</a> to learn how to generate SOAP Request body using the Free tool <a href="https://www.soapui.org/downloads/latest-release.html" target="_blank" rel="noopener">SoapUI</a>. Basically, you have to use SoapUI to generate Request XML and after that, you can replace parameters as needed in the generated body.
<h3>What is SOAP Web Service?</h3>
If you are new to SOAP Web Service sometimes referred as XML Web Service then please read some concept about SOAP Web service standard <a href="https://msdn.microsoft.com/en-us/library/ms996507.aspx?f=255&amp;MSPPError=-2147217396" target="_blank" rel="noopener">from this link</a>

There are two important aspects in SOAP Web service.
<ol>
 	<li>Getting WSDL file or URL</li>
 	<li>Knowing exact Web Service URL</li>
</ol>
<h3>What is WSDL</h3>
In very simple term WSDL (often pronounced as whiz-dull) is nothing but a document which describes Service metadata (e.g. Functions you can call, Request parameters, response structure etc). Some service simply give you WSDL as xml file you can download on local machine and then analyze or sometimes you may get direct URL (e.g. http://api.mycompany.com/hr-soap-service/?wsdl )
<h3>Example SQL Query for SOAP API call using ZappySys XML Driver</h3>
Here is an example SQL query you can write to call SOAP API. If you not sure about many details then check next few sections on how to use XML Driver User Interface to build desired SQL query to POST data to XML SOAP Web Service without any coding.
<pre class="lang:tsql decode:true">SELECT * FROM $
WITH(
	 Src='http://www.holidaywebservice.com/HolidayService_v2/HolidayService2.asmx'
	,DataConnectionType='HTTP'
	,CredentialType='Basic' --OR SoapWss
	,SoapWssPasswordType='PasswordText'
	,UserName='myuser'
	,Password='pass$$w123'
	,Filter='$.soap:Envelope.soap:Body.GetHolidaysAvailableResponse.GetHolidaysAvailableResult.HolidayCode[*]'
	,ElementsToTreatAsArray='HolidayCode'	
	,RequestMethod='POST'	
	,Header='Content-Type: text/xml;charset=UTF-8 || SOAPAction: "http://www.holidaywebservice.com/HolidayService_v2/GetHolidaysAvailable"'
	,RequestData='
&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hol="http://www.holidaywebservice.com/HolidayService_v2/"&gt;
   &lt;soapenv:Header/&gt;
   &lt;soapenv:Body&gt;
      &lt;hol:GetHolidaysAvailable&gt;
         &lt;!--type: Country - enumeration: [Canada,GreatBritain,IrelandNorthern,IrelandRepublicOf,Scotland,UnitedStates]--&gt;
         &lt;hol:countryCode&gt;UnitedStates&lt;/hol:countryCode&gt;
      &lt;/hol:GetHolidaysAvailable&gt;
   &lt;/soapenv:Body&gt;
&lt;/soapenv:Envelope&gt;'
)</pre>
Now let's look at steps to create SQL query to call SOAP API. Later we will see how to generate code for your desired programming language (e.g. C# or SQL Server)
<h3>Video Tutorial - Introduction to SOAP Web Service and SoapUI tool</h3>
Before we dive into details about calling SOAP API using ZappySys XML Driver, lets first understand what is SOAP API and how to create SOAP requests using SoapUI tool. You will learn more about this process in the later section. The video contains some fragment about using SOAP API in SSIS but just ignore that part because we will be calling Soap API using ZappySys ODBC Driver rather than SSIS Components.

&nbsp;

<iframe loading="lazy" width="560" height="315" src="https://www.youtube.com/embed/d_x5bgGjg0Y?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen="allowfullscreen" data-mce-fragment="1"></iframe>
<h3>Using SoapUI to test SOAP API call / Create Request Body XML</h3>
Assuming you have downloaded and installed <a href="https://www.soapui.org/downloads/latest-release.html" target="_blank" rel="noopener">SoapUI from here</a>, now we are ready to use WSDL for your SOAP Web Service Calls. If you do not have WSDL file or URL handy then contact your API provider (sometimes you just have to add <strong>?wsdl </strong>at the end of your Service URL to get WSDL so try that. Example: http://mycompany/myservice?wsdl ).

If you don't know what is WSDL then in short, WSDL is <strong>Web service Description Language</strong> (i.e. XML file which describes your SOAP Service). WSDL helps to craft SOAP API request Body for ZappySys XML Driver. So Let's get started.
<ol>
 	<li>Open SoapUI and click SOAP button to create new SOAP Project</li>
 	<li>Enter WSDL URL or File Path of WSDLFor example WSDL for our sample service can be accessed via this URL
<pre class="lang:default highlight:0 decode:true">http://www.dneonline.com/calculator.asmx?wsdl</pre>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-api-import-wsdl-new-soapui-project.png"><img loading="lazy" decoding="async" class="size-full wp-image-3871" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-14.png" alt="Create new SOAP API Project in SoapUI tool for SOAP API Testing" width="486" height="349" /></a>
<div style="margin-bottom: 1em;">Create new SOAP API Project in SoapUI tool for SOAP API Testing</div></li>
 	<li>Once WSDL is loaded you will see possible operations you can call for your SOAP Web Service.</li>
 	<li>If your web service requires credentials then you have to configure it. There are two common credential types for public services (<strong>SOAP WSS</strong> or <strong>BASIC</strong> )
<ol>
 	<li>
<div style="margin-bottom: 1em;">To use <strong>SOAP WSS Credentials</strong> select request node and enter UserId, Password, and <strong>WSS-PasswordType</strong> (PasswordText or PasswordHash)</div>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-api-pass-soap-wss-credentials-userid-password.png"><img loading="lazy" decoding="async" class="size-full wp-image-3872 alignnone" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-2.png" alt="Configure SOAP WSS Credentials for SoapUI (SOAP API Testing Tool)" width="294" height="544" /></a>
<div style="display: block;">Configure SOAP WSS Credentials for SoapUI (SOAP API Testing Tool)</div></li>
 	<li>To use <strong>BASIC Auth</strong> Credentials select request node and double-click it. At the bottom click on Auth (Basic) and From Authorization dropdown click Add New and Select Basic.<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-api-pass-basic-authentication-userid-password.png"><img loading="lazy" decoding="async" class="size-full wp-image-3873" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-2.png" alt="Configure Basic Authorization for SoapUI (SOAP API Testing Tool)" width="616" height="653" /></a>
<div style="margin-bottom: 1em;">Configure Basic Authorization for SoapUI (SOAP API Testing Tool)</div></li>
</ol>
</li>
 	<li>Now you can test your request first Double-click on the request node to open request editor.</li>
 	<li>Change necessary parameters, remove optional or unwanted parameters. If you want to regenerate request you can click on <strong>Recreate default request toolbar icon</strong>.
<a href="https://zappysys.com/blog/wp-content/uploads/2016/06/create-soap-request-with-optional-parameters-soapui.png"><img loading="lazy" decoding="async" class="size-full wp-image-2812" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-4.png" alt="Create SOAP Request XML (With Optional Parameters)" width="807" height="315" /></a>
<div style="margin-bottom: 1em;">Create SOAP Request XML (With Optional Parameters)</div></li>
 	<li>Once your SOAP Request XML is ready, <strong>Click the Play button</strong> in the toolbar to execute SOAP API Request and Response will appear in Right side panel.
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/soapui-test-soap-api-request-response-edit-xml-body.png"><img loading="lazy" decoding="async" class="size-full wp-image-3874" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-5.png" alt="Test SOAP API using SoapUI Tool (Change Default XML Body / Parameters, Execute and See Response)" width="1216" height="511" /></a>
Test SOAP API using SoapUI Tool (Change Default XML Body / Parameters, Execute and See Response)</li>
</ol>
<h3>Create DSN using ZappySys XML Driver to call SOAP API</h3>
Once you have tested your SOAP API in SoapUI tool, we are ready to use ZappySys XML driver to call SOAP API in your preferred BI tool or Programming language.
<ol>
 	<li>First open <strong>ODBC Data Sources</strong> (search ODBC in your start menu or go under ZappySys &gt; ODBC PowerPack &gt; <strong>ODBC 64 bit</strong>)</li>
 	<li>Goto <strong>System DSN</strong> Tab (or User DSN which is not used by Service account)</li>
 	<li>Click <strong>Add</strong> and Select ZappySys XML Driver
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/zappysys-odbc-xml-soap-api-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3875" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-6.png" alt="ZappySys ODBC Driver for XML / SOAP API" width="593" height="459" /></a>
ZappySys ODBC Driver for XML / SOAP API</li>
 	<li>Configure API URL, Request Method and Request Body as below
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-web-service-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3876" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-7.png" alt="ZappySys XML Driver - Calling SOAP API - Configure URL, Method, Body" width="916" height="874" /></a>
ZappySys XML Driver - Calling SOAP API - Configure URL, Method, Body</li>
 	<li><strong>(This step is Optional)</strong> If your SOAP API requires credentials then Select Connection Type to HTTP and configure as below.
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/soap-api-call-credential-basic-soap-wss-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3877" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-8.png" alt="ZappySys XML Driver - Configure SOAP WSS Credentials or Basic Authorization (Userid, Password)" width="564" height="483" /></a>
<div style="display: block;">ZappySys XML Driver - Configure SOAP WSS Credentials or Basic Authorization (Userid, Password)</div></li>
 	<li>Configure-Request Headers as below (You can get it from Request &gt; Raw tab from SoapUI after you test the request by clicking the Play button)
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/set-soap-api-request-headers-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3881" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-9.png" alt="Configure SOAP API Request Headers - ZappySys XML Driver" width="1009" height="747" /></a>
Configure SOAP API Request Headers - ZappySys XML Driver</li>
 	<li>Once credentials entered you can select Filter to extract data from the desired node. Make sure to select array node (see special icon) or select the node which contains all necessary columns if you don't have array node.
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/soap-api-query-select-filter-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3882" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-10.png" alt="Select Filter - Extract data from nested XML / SOAP API Response (Denormalize Hierarchy)" width="809" height="594" /></a>
Select Filter - Extract data from nested XML / SOAP API Response (Denormalize Hierarchy)</li>
 	<li>If prompted select yes to treat selected node as Array (This is helpful when you expect one or more record for selected node)
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/xml-api-array-handling-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3883" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-11.png" alt="Treat selected node as XML Array Option for SOAP API Response XML" width="655" height="572" /></a>
Treat selected node as XML Array Option for SOAP API Response XML</li>
</ol>
<h3>Preview SOAP API Response / Generate SQL Code for SOAP API Call</h3>
Once you configure settings for XML Driver now you can preview data or generate example code for desired language (e.g. C#, Python, Java, SQL Server).

Go to Preview tab and you will see default query generated based on settings you entered in previous sections. Attributes listed in WITH clause are optional. If you omit attribute in WITH clause it will use it from Properties tab.
<h3>Preview Data</h3>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-web-service-zappysys-xml-api-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3884" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-12.png" alt="Preview SOAP API Response in ZappySys XML Driver" width="808" height="780" /></a>
Preview SOAP API Response in ZappySys XML Driver
<h3>Generate Code Option</h3>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/zappysys-driver-code-generator.png"><img loading="lazy" decoding="async" class="size-full wp-image-3885" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-13.png" alt="Generate Example Code for ZappySys Driver" width="572" height="618" /></a>
<div style="display: block;">Generate Example Code for ZappySys Driver</div></div>
<h2>REST API Pagination in Informatica</h2>
<div class="content_block" id="custom_post_widget-3892"><div style="margin-bottom: 1em;">Even we set up ODBC Data Source to get the data, it may not be enough. Usually, if you are getting a huge data set from API provider, it won't give it to you in one HTTP response. Instead, it gives back only a subset of data and provides a mechanism for data pagination. The good news is that <em>ZappySys ODBC Driver</em> includes many options to cover virtually any pagination method.</div>
<div><span style="font-size: 16px;">Below you will find a few examples of API pagination. If you need something more sophisticated check the below link (the article was written for SSIS PowerPack but UI options and concepts apply to ODBC Driver too):</span></div>
<div style="margin-bottom: 1em;"><a href="https://zappysys.com/blog/ssis-rest-api-looping-until-no-more-pages-found/" target="_blank" rel="noopener">https://zappysys.com/blog/ssis-rest-api-looping-until-no-more-pages-found/</a></div>
<h3>Paginate by Response Attribute</h3>
This example shows how to paginate API calls where you need to paginate until the last page detected. In this example, next page is indicated by some attribute called nextlink (found in response). If this attribute is missing or null then it stops fetching the next page.
<pre class="lang:tsql decode:true codeblock">SELECT * FROM $
WITH(
SRC=@'https://zappysys.com/downloads/files/test/pagination_nextlink_inarray_1.json'
,NextUrlAttributeOrExpr = '$.nextlink'  --keep reading until this attribute is missing. If attribute name contains dot then use brackets like this $.['my.attr.name']
)</pre>
<h3>Paginate by URL Parameter (Loop until certain StatusCode)</h3>
This example shows how to paginate API calls where you need to pass page number via URL. The driver keeps incrementing page number and calls next URL until the last page detected (401 error). There are few ways to indicate the last page (e.g. By status code, By row count, By response size). If you don't specify end detection then it will use the default (i.e. No records found).
<pre class="lang:tsql decode:true codeblock">SELECT * FROM $
WITH (
SRC=@'https://zappysys.com/downloads/files/test/page-xml.aspx?page=1&amp;mode=DetectBasedOnResponseStatusCode'
,PagingMode='ByUrlParameter'
,PagingByUrlAttributeName='page'
,PagingByUrlEndStrategy='DetectBasedOnResponseStatusCode'
,PagingByUrlCheckResponseStatusCode=401
,IncrementBy=1
)</pre>
<h3>Paginate by URL Path (Loop until no record)</h3>
This example shows how to paginate API calls where you need to pass page number via URL Path. The driver keeps incrementing page number and calls next URL until the last page is detected. There are few ways to indicate the last page (e.g. By status code, By row count, By response size). If you don't specify end detection then it will use the default (i.e. No records found).
<pre class="lang:tsql decode:true codeblock">SELECT * FROM $
WITH (
SRC=@'https://zappysys.com/downloads/files/test/cust-&lt;%page%&gt;.xml'
,PagingMode='ByUrlPath'
,PagingByUrlAttributeName='&lt;%page%&gt;'
,PagingByUrlEndStrategy='DetectBasedOnRecordCount'
,IncrementBy=1
)</pre>
<h3>Paginate by Header Link (RFC 5988)</h3>
API like GitHub / Wordpress use Next link in Headers (<a href="https://tools.ietf.org/html/rfc5988" target="_blank" rel="noopener">RFC 5988</a>)
<pre class="lang:default decode:true ">SELECT * FROM $
LIMIT 25
WITH(
	 Src='https://wordpress.org/news/wp-json/wp/v2/categories?per_page=10'
	,PagingMode='ByResponseHeaderRfc5988'
	,WaitTimeMs='200' --//wait 200 ms after each request
)</pre>
&nbsp;</div>
<h2>Error Handling in REST API</h2>
<div class="content_block" id="custom_post_widget-3894">Sometimes errors occur... they just do and there is nothing you can do! Or can you? Actually, in ODBC PowerPack you can handle them in two ways.
<h3>METHOD 1 - Using Error Handling Options</h3>
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-3949" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-api-error-handling-1.png" alt="" width="668" height="702" />
<h4>When to use?</h4>
You may want to use them when your source is a resource located on the Internet; e.g. a file on a website, a file on an FTP server or just a plain API HTTP response. By default, when a remote server returns an error, data retrieval is stopped, an error is raised and no data is given back to you. This might not be always desirable.
<h4>Scenario 1</h4>
Imagine a scenario, that there is a web server which each day at 12 AM releases a new JSON file with that day's date as filename, e.g. <span style="text-decoration: underline;"><em>http://www.some-server.com/data/2018-06-20.json</em></span>. And, of course, you want to download it and use it daily in your Power BI report. But you have a problem: Power BI report data sources are refreshed each hour and you may get <a href="https://en.wikipedia.org/wiki/HTTP_404" target="_blank" rel="noopener">HTTP 404 status code</a> (no file was found) when a file is not released yet. Which consequentially means other data sources won't be updated as well and you will see old and cached data on the report. That's where you could use <strong><span class="lang:default highlight:0 decode:true crayon-inline">Continue on any error</span></strong> or <strong><span class="lang:default highlight:0 decode:true crayon-inline">Continue when Url is invalid or missing (404 Errors)</span></strong> to avoid an error being raised and let other data sources to be updated.
<h4>Scenario 2</h4>
Another scenario is when you expect a web server to raise some kind of HTTP error when accessing a URL. You don't want ODBC Data Source to raise an error but instead, you want to get response data. That's where you can use <strong><span class="lang:default highlight:0 decode:true crayon-inline">Continue on any error</span></strong> or alike together with  <strong><span class="lang:default highlight:0 decode:true crayon-inline">Get response data on error</span></strong> to continue on an error and get the data:

<img loading="lazy" decoding="async" class="alignnone wp-image-3961 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-get-response-data-on-error.png" alt="" width="547" height="235" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-get-response-data-on-error.png 547w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-get-response-data-on-error-300x129.png 300w" sizes="(max-width: 547px) 100vw, 547px" />
<h3>METHOD 2 - Using Connection [Retry Settings]</h3>
Another scenario you may run into is a buggy web server. You ask it to give you some file or data and it, like a snotty kid, just doesn't give it to you! You have to ask twice or thrice before it does its job. If that's the case, you have to retry HTTP requests using <em>Connection</em>:

<img loading="lazy" decoding="async" class="alignnone wp-image-3963 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-api-error-handling-3.png" alt="" width="671" height="572" /></div>
<h2>Performance consideration for REST API</h2>
<p>Coming soon&#8230;</p>
<h2>Security consideration for REST API</h2>
<div class="content_block" id="custom_post_widget-3896"><div style="margin-bottom: 1em;">If you need to authenticate or authorize your user to access a web resource, you will need to use one of the <em>Connections:</em></div>
<ul>
 	<li>HTTP</li>
 	<li>OAuth</li>
</ul>
<img loading="lazy" decoding="async" class="wp-image-4078 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-authentication-authorization-e1529337108252.png" alt="ZappySys XML Driver - HTTP and OAuth Connection Types" width="577" height="302" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-authentication-authorization-e1529337108252.png 577w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-authentication-authorization-e1529337108252-300x157.png 300w" sizes="(max-width: 577px) 100vw, 577px" />
<h3>HTTP Connection</h3>
<div style="margin-bottom: 1em;">Use <em>HTTP Connection</em> for simple Windows, Basic, NTLM or Kerberos authentication. Just fill in a username and a password and you are good to go!</div>
<div style="margin-bottom: 1em;">You can also use <em>HTTP Connection</em> for more sophisticated authentication like:</div>
<ul>
 	<li><strong>SOAP WSS</strong> (when accessing a SOAP WebService)</li>
 	<li><strong>Static Token / API Key</strong> (when need to pass an API key in HTTP header)</li>
 	<li><strong>Dynamic Token</strong> (same as Static Token method except that each time you need to log in and retrieve a fresh API key)</li>
 	<li><strong>JWT Token</strong> (As per RFC 7519)</li>
</ul>
<img loading="lazy" decoding="async" class="alignnone wp-image-4091 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-api-connection-type-1.png" alt="" width="622" height="570" />
<h3>OAuth</h3>
If you are trying to access REST API resource, it is a huge chance, you will need to use <em>OAuth Connection</em>. <a href="https://zappysys.com/blog/rest-api-authentication-with-oauth-2-0-using-ssis/" target="_blank" rel="noopener">Read this article</a> to understand how OAuth authentication and authorization works and how to use it (article originally was written for <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a>, but the concepts and UI stay the same): <br/>
<a href="https://zappysys.com/blog/rest-api-authentication-with-oauth-2-0-using-ssis/" target="_blank" rel="noopener">https://zappysys.com/blog/rest-api-authentication-with-oauth-2-0-using-ssis/</a>
<img loading="lazy" decoding="async" class="alignnone size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-api-connection-type-2.png" width="721" height="708" /></div>
<h2>Conclusion</h2>
<p>Consuming data from JSON files or REST API in Informatica can be challenging but not to worry anymore. Using ZappySys JSON Driver you get most innovative JSON processing engine which not only processes/denormalizes nested JSON but also gives you 100+ Options to cover almost any API processing scenario. You can use this driver to consume data in any ODBC compliant app (i.e. Tableau, Power BI, Excel) and Programming Languages (i.e. C#, Java, Python, PHP). <a href="https://zappysys.com/products/odbc-powerpack/">Click here to Download a FREE trial of ZappySys ODBC PowerPack</a> and learn how to perform JSON / API integration in Informatica without any coding.</p>
<h2>Keywords</h2>
<p>how to import json file in informatica | how to read json file in informatica powercenter | how to test json from informatica | how to use jsaon file as source in informatica power center | how to use json in informatica 10 | informatica how to import data from rest api | informatica jtx to import json file (use of java transformation) | informatica plugin for restful api using json | informatica power center and json support | informatica read json files | informatica rest api | informatica rest api connector | json parser import informatica</p>
<p>The post <a href="https://zappysys.com/blog/read-json-informatica-import-rest-api-json-file/">Read JSON in Informatica &#8211; Import REST API / SOAP / JSON File</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Amazon Redshift data load in Informatica PowerCenter</title>
		<link>https://zappysys.com/blog/amazon-redshift-data-load-in-informatica-powercenter/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Wed, 17 Feb 2016 23:42:41 +0000</pubDate>
				<category><![CDATA[Redshift]]></category>
		<category><![CDATA[Amazon Redshift]]></category>
		<category><![CDATA[Amazon S3]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[Informatica]]></category>
		<category><![CDATA[PowerCenter]]></category>
		<category><![CDATA[redshift]]></category>
		<category><![CDATA[ZappyShell]]></category>
		<guid isPermaLink="false">http://zappysys.com/blog/?p=360</guid>

					<description><![CDATA[<p>Introduction In our previous post you learned how to load data into Redshift using SSIS. Now in this post you will learn how to load data into Redshift using Informatica PowerCenter. For PowerCenter we will use ZappyShell Command line for Redshift Data Load. This small powerful command line utility can handle load of several millions [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/amazon-redshift-data-load-in-informatica-powercenter/">Amazon Redshift data load in Informatica PowerCenter</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p>In our <a href="https://zappysys.com/posts/sql-server-to-redshift-data-load-using-ssis/#Command_line_approach_for_SQL_Server_to_Redshift_data_load" target="_blank">previous post</a> you learned how to load data into Redshift using SSIS. Now in this post you will learn how to load data into Redshift using <strong>Informatica PowerCenter</strong>. For PowerCenter we will use <a href="//zappysys.com/products/zappyshell/amazon-redshift-command-line-tools/" target="_blank">ZappyShell Command line for Redshift Data Load</a>. This small powerful command line utility can handle load of several millions or billions records in few minutes. It uses parallel execution engine which takes care most tedious steps of loading data into Amazon Redshift.</p>
<h2>Using informatica command task to load data into redshift</h2>
<p>Informatica PowerCenter has simple task to execute command lines. you can use this task to execute ZappyShell command line. Perform following steps to load data.</p>
<ol>
<li>Download and install <a href="//zappysys.com/products/zappyshell/amazon-redshift-command-line-tools/" target="_blank">ZappyShell for Amazon Redshift from here</a></li>
<li>Now you ready to data into Amazon Redshift</li>
<li>Drag new command task into your Informatica workflow</li>
<li>Enter below command to load data from SQL Server to Redshift. If you have ODBC connectivity then use ODBC DSN to read your data.</li>
<li>You can use script file approach too where each command line parameter can be nicely wrapped in new line.<br />
Here is sample command you can try to load data from SQL Server to Redshift. if you have ODBC connectivity then use ODBC DSN to read your data.<br />
<pre class="crayon-plain-tag">c:\zappyshell\aws.exe import Db 
	--source-driver ADONET_MSSQL 
	--source-query "select ROW_NUMBER()Over(order by a.CustomerID) Id, a.*,b.*,c.OrderID,c.OrderDate,c.Freight  from customers a,products b,orders c" 
	--source-archivemethod None 
	--source-stage-archivemethod Delete 
	--target-stage-archivemethod Delete 
	--source-stagepath "c:\redshift\stage" 
	--target-table "customerdata" 
	--target-stagepath "bw-rstest/cmdstage" 
	--target-truncate 
	--logfile "c:\redshift\log.txt" 
	--maxrows-perfile 100000 
	--region us-east-1 
	--accesskey "AKIA*****************" 
	--secretkey "lPi+XQ************************"  
	--source-connstr "Data Source=localhost;Initial Catalog=Northwind;Integrated Security=SSPI;"  
	--target-connstr "Host=mytestcluster-1.csu********.us-east-1.redshift.amazonaws.com;Port=5439;Database=dev;UserName=masteruser;Password=*********;EnableSsl=true;Timeout=30;CommandTimeout=3600;"</pre>
</li>
<li>For complete help on import command check help file //zappysys.com/onlinehelp/zappyshell/scr/aws/aws-redshift-import.htm</li>
</ol>
<div id="attachment_405" style="width: 746px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/02/amazon-redshift-import-command-line-tools-copy-s3-aws.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-405" class="size-full wp-image-405" src="//zappysys.com/blog/wp-content/uploads/2016/02/amazon-redshift-import-command-line-tools-copy-s3-aws.png" alt="Informatica PowerCenter Redshift Data Load - Amazon Redshift Import Command line tools (COPY, S3, AWS)" width="736" height="571" srcset="https://zappysys.com/blog/wp-content/uploads/2016/02/amazon-redshift-import-command-line-tools-copy-s3-aws.png 736w, https://zappysys.com/blog/wp-content/uploads/2016/02/amazon-redshift-import-command-line-tools-copy-s3-aws-300x233.png 300w" sizes="(max-width: 736px) 100vw, 736px" /></a><p id="caption-attachment-405" class="wp-caption-text">Informatica PowerCenter Redshift Data Load &#8211; Amazon Redshift Import Command line tools (COPY, S3, AWS)</p></div>
<h2>ZappyShell Command Line for Redshift</h2>
<p>Below are few feature for Command line for Amazon Redshift</p>
<p>◾Import data to AWS Redshift database from files or relational source (e.g. MySQL, Oracle, SQL Server)<br />
◾Import huge amount of data (millions of rows) in few minutes with parallel load techniques<br />
◾Load local flat files to Redshift in just single line command (option to compress data files to *.gz to speed up transfer)<br />
◾Support for Client side encryption using AES 256 Key<br />
◾Load data from any data source (ODBC,ADO.net or OLEDB) using sql query<br />
◾Import compressed data files (*.gz) to redshift<br />
◾Archive files, error reporting, file splitting, many other features</p>
<a href="https://zappysys.com/blog/amazon-redshift-data-load-in-informatica-powercenter/"><img decoding="async" src="https://zappysys.com/blog/wp-content/plugins/wp-youtube-lyte/lyteCache.php?origThumbUrl=%2F%2Fi.ytimg.com%2Fvi%2FOz5Rfztzo0U%2Fhqdefault.jpg" alt="YouTube Video"></a><br /><br /></p>
<p>The post <a href="https://zappysys.com/blog/amazon-redshift-data-load-in-informatica-powercenter/">Amazon Redshift data load in Informatica PowerCenter</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
