Informatica Data Connections Tutorial
Informatica PowerCenter accesses the information or data from different sources such as Flat files, XML, Relational Databases, SAP Hana, Teradata, Mainframes, Excel, and Access. Similarly, Informatica supports the same destinations to load data. This section of Informatica Tutorial covers the different types of Data Connections, and basic ETL operations.
In this article, we will show you, How to connect with the Relational databases using the Informatica ODBC Connection with an example. For this article, we are using the Microsoft SQL Server as our relational database.
TIP: Please refer Informatica Source Analyzer article to understand the Source Analyzer.
From the below screenshot you can observe that we are in the Informatica Source Analyzer. Once you are in Source Analyzer, Please navigate to Source menu and select the Import from Database.. option as shown below
Once you select the Import from Database.. option, Import tables window will be opened as shown below. Currently, we don’t have any ODBC connection to select from the drop-down list. In order to add a new one, please click on the … button as shown below
Once you click on the … button, ODBC Data Source Administrator Window will be opened to add a new ODBC connection. Click on the Add button to do so.
Once you click on the Add button, Create New Data Source window will be opened. Here we have an option to select the required database from the available list. As we said before, we are using SQL Server so we are selecting the DataDirect 7.1 SQL Server Wire Protocol for this example.
This will open the new pop up window called ODBC SQL Server Legacy Wire Protocol Driver Setup. Here we have to fill the required details to connect with our database.
Once you have done, Click the Apply button and then click OK button to close the window
NOTE: Once you fill the required details, It is always advisable to Test your connection using the Test Connection button
From the below screenshot, you can see our newly created Informatica ODBC Connection so click OK button. If you want to select this connection as a data source then, Please refer Database Source in Informatica article.
In this article, we will show you, How to import data from relational Databases such as Microsoft SQL Server, Oracle, Teradata etc and use them as Database source in Informatica Source Analyzer.
Before we start doing anything, First connect to Informatica repository service with your Admin credentials and then Navigate to Source Analyzer. Please refer Informatica Source Analyzer article to understand the Source Analyzer. From the below screenshot you can observe that we are in the Source Analyzer.
NOTE: Source Menu in the Menu bar will be available only when you are in the Source Analyzer section otherwise, it will be hidden
Once you are in Source Analyzer, Please navigate to Source menu and select the Import from Database.. option as shown below
Once you select the Import from Database.. option, a new window called Import tables will be opened as shown below. Please select the ODBC connection that we already created in our previous article from the drop-down list. In order to create a new one, please refer the Informatica ODBC Connection article.
Next, We have to provide the credentials required to connect with the respective database. Here we are providing the Username and password of our Microsoft SQL Server 2014 and owner name as dbo.
Once you fill the details, please click on the connect button. This will connect the database and display the tables and Views present in the database.
If you want to see the data from all owners then, Please change the owner name from dbo to default All. This can be done by clicking the All button below the Show Owners section
From the below screenshot you can observe that we are selecting the DimProducts table from our Adventure Works DW 2014 database. Here you can select more than one table also.
TIP: If you find difficult to track your required table(s) then, you can type the table name under the Search for tables named and click on the search button
From the below screenshot you can observe that under the Source subfolder you can see our newly created database source in Informatica and the table definition (Column Names and appropriate data types) inside our workspace.
Although we imported our source from the SQL database, before we proceed further we should preview our data. In order to preview the source data, Right click on the table definition and select the Preview data.. option from the context menu.
Once you select the Preview data.. option, Preview data window will be opened. here you have to provide the credentials (Username and password) required to connect with the respective database and click the connect button. Once you successfully connected to your database, data inside the table (here DimProducts) will be displayed as shown below
Although we selected the DimProducts, we may not require all the columns present in that table. To resolve this, we can edit the table by Right click on the table definition and selecting the Edit.. option from the context menu.
Once you select the Edit.. option, a new window called Edit tables will be opened as shown below. In order to alter or change the existing table, we have to navigate to Columns Tab.
For example, if you want to add new columns then, Please select the below shown button and add Column Name, Data Type, Precision (if required), Scale (if required), If it is primary key then change the Key type to primary and check mark the Not Null option (if your column doesn’t allow null values)
If you want to delete a few columns then select the unwanted columns and click the scissors button as shown below. Here we are removing a few columns for the demonstration purpose. Once you are done editing, Click OK to close the Edit tables window
From the below screenshot you can observe that we successfully deleted the unwanted columns from the source definition.
NOTE: We are removing the columns only from the Informatica Source Analyzer. This will not reflect the underlying database data.
In this article, we will show you, How to import data from flat files of both Delimited type, Fixed Width type and use them as Flat File source in Informatica Source Analyzer. Before we start importing data from the flat file, let us see the data inside the flat file.
The following screenshot will show you the same and our task is to import this comma delimited text file as the Flat File Source in Informatica.
Before we start doing anything, First connect to Informatica repository service with your Admin credentials and then Navigate to Source Analyzer. Please refer Informatica Source Analyzer article to understand the Source Analyzer. From the below screenshot you can observe that we are in the Source Analyzer.
NOTE: Source Menu in the Menu bar will be available only when you are in the Source Analyzer section otherwise, it will be hidden
Once you are in Source Analyzer, Please navigate to Source menu and select the Import from File.. option as shown below
Once you select the Import from File.. option, a new window called Open Flat Filewill be opened as shown below. Please select the required flat file from your local file system and click the Open button. For this example, we are selecting the GeoImport.txt file.
Once you click the Open button, a new pop up window called Flat File Import Wizard will be opened as shown below. This wizard can help us to specify the text format easily. First, Under Choose the file type that best describes your datasection we have to choose either a Delimited or Fixed Width option. Our text is separated by comma delimiter as we shown earlier so we are selecting a Delimited option.
If you flat file contains column names as first line of data like our example file then, you have to change the Start Import at Row value from 1 to 2 otherwise keep it as 1. If you forgot to change then, while exporting this data to the database then Type casting errors will throw.
Import filed names from the first line: This option allows us to import the column names from the first line of a flat file. If your flat file contains column names as the first line of data like our example file then, by selecting this option will import column names and this will automatically change the Start Import at Row value from 1 to 2
Within the Step 2:
Here, we can edit the Column Name, Data type, Length or Precision, Scale and Width. In general, we don’t do that but if you want you can do it.
From the below screenshot you can observe that, under the Source sub folder you can see our newly created Flat File source in Informatica and the table definition (Column Names and appropriate data types) inside our work space.
Although we created our Flat File source, before we proceed further we should preview our data. In order to preview the source data, Right click on the table definition and select the Preview data.. option from the context menu.
Once you select the Preview data.. option, Preview data window will be opened. Please select the GeoImport.txt file as a Flat File name from your local file system and click the Open button.
Once you successfully selected your file, data inside the flat file (here GeoImport.txt) will be displayed as shown below
Although we selected the GeoImport.txt file as source definition, there are many situations where we may not require all the columns present in that table or we may have to add extra columns. To resolve these type of situations, we can edit the table by Right click on the table definition and selecting the Edit.. option from the context menu.
Once you select the Edit.. option, a new window called Edit tables will be opened as show below. In order to alter or change the existing table, we have to navigate to Columns Tab.
For example, if you want to add new columns then, Please select the first button (before scissors symbol) and add Column Name, Data Type, Precision (if required), Scale (if required), If it is primary key then change the Key type to primary and check mark the Not Null option (if your column doesn’t allow null values)
If you want to delete columns then select the unwanted columns and click the scissors button as shown below. Here we are removing a few columns for the demonstration purpose. Once you done editing, Click OK to close the Edit tableswindow
From the below screenshot you can observe that, we successfully deleted the unwanted columns from our flat file source definition.
NOTE: We are removing the columns only from the Informatica Source Analyzer. This will not reflect the underlying flat file.
In this article, we will show you, How to import data from Excel workbooks and use them as an Excel source in Informatica Source Analyzer. Before we start importing data from the excel file, let us see the data inside the excel sheet.
The following screenshot will show you the data inside the excel file. Our task is to import this excel workbook and use this data as the Excel Source in Informatica.
Before we start doing anything, First connect to Informatica repository service with your Admin credentials and then Navigate to Source Analyzer. Please refer Informatica Source Analyzer article to understand the Source Analyzer. From the below screenshot you can observe that we are in the Source Analyzer.
NOTE: Source Menu in the Menu bar will be available only when you are in the Source Analyzer section otherwise, it will be hidden
Once you are in Source Analyzer, Please navigate to Source menu and select the Import from Database.. option as shown below
Once you select the Import from Database.. option, Import tables window will be opened as shown below. Currently, we don’t have any ODBC connection to select from the drop-down list. In order to add a new one, please click on the … button as shown below
Once you click on the … button, ODBC Data Source Administrator Window will be opened to add a new ODBC connection. Click on the Add button to do so.
Once you click on the Add button, Create New Data Source window will be opened. Here we have an option to select the required driver from the available list. As we said before, we need to import excel files so we are selecting the Driver to Microsoft Excel for this example.
You can also select the Microsoft Excel Driver as shown below
This will open the new pop up window called ODBC Microsoft Excel Setup. Here we have to fill the required details:
Next, Click on the Select workbook.. button to select the required excel file
Once you click on the Select workbook.. button, the following window will be opened to select the required workbooks from our local file system. Once you are done selecting, Click the OK button to close the window
From the drop-down list, Please select the ODBC connection that we created now.
Next, we have to select the required tables from the Excel workbooks. From the below screenshot you can observe that Multi_Cast book has only one table and we are selecting the same. Here you can select more than one table also.
TIP: If you find difficult to track your required table(s) then, you can type the table name under the Search for tables named and click on the search button
From the below screenshot you can observe that under the Source subfolder you can see our newly created Excel source in Informatica and the table definition (Column Names and appropriate data types) inside our workspace.
Although we created our Excel source, before we proceed further we should preview our data. In order to preview the source data, Right click on the table definition and select the Preview data.. option from the context menu.
Once you select the Preview data.. option, Preview data window will be opened. Here you have to provide the credentials (if there are any) required to connect with your local file system and click the connect button. Once you successfully connected, data inside the table (here Multi_cast table) will be displayed as shown below
Although we selected the Multi_Cast.xls file as source definition, there are many situations where we may not require all the columns present in that table or we may have to add extra columns. To resolve these type of situations, we can edit the table by Right click on the table definition and selecting the Edit.. option from the context menu.
Selecting the Edit.. option open a new window called Edit tables as shown below. In order to alter or change the existing table, we have to navigate to Columns Tab. For example,
NOTE: We are removing the columns only from the Informatica Source Analyzer. This will not reflect the underlying flat file.
In this article, we will show you, How to Move Data from SQL Server to another in Informatica with an example. For this example, we are going to use the below show data (Customers table)
and the Destination table is Duplicate Cust. As you can see, it is an Empty table
Before we start configuring the Informatica to Move Data from one SQL ServerDatabase to another database. First, connect to Informatica repository service by providing the Informatica Admin Console credential.
TIP: Here you have to provide the Admin Username and password that you specified while installing the Informatica Server.
Once you connected successfully, Please navigate to Source Analyzer to define your Sources. As we said before, we are using Customers table from SQL Server database as our source definitions. So, go to the Source menu and select the Import from Database.. option as shown below.
Please select the ODBC connection that will connect the Informatica with the SQL Tutorial Database. In order to create a new one, please refer Informatica ODBC Connection article.
From the below screenshot you can observe that we are selecting the Customers table from our SQL Tutorial database.
This will add the table definition (Column Names and appropriate data types) inside our workspace under the Source Analyzer. Please refer Database Source to understand the creation of source definition
Please navigate to Target Designer to define the Target. In this example, we are using the existing SQL table as our target definition. So, go to the Targets menu and select the Import from Database.. option as shown below.
Please select the ODBC connection that will connect the Informatica with the SQLTest Database. In order to create a new one, please refer the Informatica ODBC Connection article.
From the below screenshot you can observe that we are selecting the DeplicateCust table from our SQLTest database. You can refer to Create Target table using Source Definition to understand the process of creating a target definition
To create a new mapping, Please navigate to Mappings menu in Menu Bar and select the Create.. option.
This will open the Mapping Name window to write a unique name for this mapping. Let me write m_move_data_from_SQL_to_sql and click OK button.
TIP: Please refer Informatica Mapping article to understand the procedure for creating Mapping
Drag and drop the Customers source definitions from Sources folder to the mapping designer. Once you drag the source, Power Center designer will automatically create the source qualifier for you. I suggest you refer Source Qualifier Transformation article
Next, Drag and drop the target definition from Targets folder to the mapping designer. Next, connect the source qualifier with the target definition. Please use the Autolink.. option to connect them.
Before we close the Mapping, Let us Save, and Validate the mapping by going to Mapping Menu bar, and select the Validate option.
After we finish creating the Mapping, we have to create the workflow for it. Power Center Workflow manager provides two approaches to create a workflow.
In this example, we will create the Workflow manually. To do so, Please navigate to Workflows Menu and select the Create option.
This will open Create Workflow window as shown below. Please provide the unique name (wf_move_from_SQL_to_SQL) and leave the default settings.
This will create a Workflow for you
Once we created the workflow, our next step is to create a session task for our mapping.
There are two types of sessions in Informatica:
For this example, we created a Non-reusable Session. In order to create Non-reusable Session, Please navigate to Tasks Menu and select the Create option as shown below.
Name it as s_move_data_from_sql_to_SQL.
Once you click on the Create button, a new window called Mappings will be opened. Here you have to select the mapping that you want to associate with this session.
Please link the Start Task, and the Session Task.
Double click on the Session task will open the Edit Tasks window. Within Properties Tab, we have two common properties that we have to configure for the relational databases.
$Source connection value: This property will store the relational source information in $Source variable. So, click on the Arrow we marked below, and select the SQL Tutorial as the source information.
$Target connection value: This property will store the relational target information in $Target variable. So, click on the Arrow we marked below, and select the SQL Test target as the Target information.
Within the mappings tab, we have to configure the Source, target Connections and some common properties. First, let us configure the source connections by clicking on the SQ_Customers source present in the Sources folder.
Within the Connections, click on the Arrow button beside the Relational type, and use the Connection variable that we created in our previous step i.e., $Source
Now, we have to configure the Target Connection. So, let us configure the target connection by clicking on the DuplicateCust present in the Targets folder.
Within the Connections, click on the Arrow button beside the Relational type, and use the Connection variable that we created in our previous step i.e., $Target
We are changing the Target Load Type to Normal.
Next, navigate to Workflows Menu and select the Validate option to validate the Workflow. Now, Let me start the Workflow. To do so, navigate to the Workflows menu, and select the Start Workflow option.
Once you select the Start Workflow option, Informatica PowerCenter Workflow monitor will be opened to monitor the workflow. From the below screenshot you can observe that our workflow is executed without any errors.
Let us open the SQL Server Management Studio to check whether we successfully transfer the data from a source or not.
In this article, we will show you how to Export Data from SQL Server to Flat File in Informatica with an example. For this Informatica Export Data from SQL Server to Flat File example, we are going to use the below show data (Employe table)
Before we start configuring the Informatica to Export Data from SQL Server to Text File (or Flat File). First, connect to Informatica repository service by providing the Informatica Admin Console Username and password you specified while installing the Informatica Server.
Please navigate to Source Analyzer to define your Informatica Sources. As we said before, we are using the Employee table present in the SQL Server database as our source definitions. So, go to the Source menu and select the Import from Database.. option.
Please select the ODBC connection that will connect the Informatica with the SQL Tutorial Database. To create a new one, please refer to the Informatica ODBC Connection article.
From the below screenshot, we are selecting the Employee table from our SQL Tutorial database.
It will add the table definition (Column Names, and appropriate data types) inside our workspace under the Source Analyzer. Please refer Database Source to understand the creation of source definition
Please navigate to Target Designer to define the Target. In this Informatica Export Data from SQL Server to Flat File example, our task is to create a Text File target. So, go to the Targets menu and select the Create option.
Once you select the Create option, a new window called Create Target table displayed. Please provide a unique name for the target table, and select the database type as Flat File.
Once you complete, Please click on the Create button to create a new empty table in our PowerCenter Target Designer.
From the below screenshot, see that we successfully created a new empty table in our Target Designer.
To add new columns, we have to edit the table definition. It can be done by Right-click on the table, and select the Edit.. option from the context menu. Once you select the Edit.. option, a new window called Edit tables will open.
By default, Flat File columns separated by the Comma Delimiter. But, you can control the same by clicking the Advanced button
Here, you can change the Column Delimiter, and you can add Single Quoted, or double quotes each column value.
Next, go to the Columns Tab to add new columns. Please select the first button (before the scissors symbol). It will open the empty row to add Column Name, Data Type, Precision (if required), Scale (if needed).
If it is a primary key, change the Key type to primary and check to mark the Not Null option (if your column doesn’t allow null values)
From the below screenshot, we added four columns.
You can use the Properties tab to define the Date time Format or to change the default format. Once you added the required columns, Click OK to close the Edit tables window
Now you can that the target table had required column names.
To create a new mapping, Please navigate to Mappings menu in Menu Bar, and select the Create.. option.
It opens the Mapping Name window to write a unique name for this mapping. Let me write m_export_SQL_to_text and click the OK button.
Drag and drop the Employe source definitions from Sources folder to the mapping designer. Once you drag the source, the Power Center designer automatically creates the Source Qualifier Transformation for you.
Next, Drag and drop the target definition from Targets folder to the mapping designer. Next, connect the Informatica Export Data from SQL Server to Flat File source qualifier with the target definition using the Autolink.. option.
Let us Save and Validate the mapping by going to Mapping and select the Validate option.
After we finish creating the Informatica Export Data from SQL Server to Flat File Mapping, we have to create the workflow for it. Power Center Workflow manager provides two approaches to create a workflow.
In this Informatica Export Data from SQL Server to Flat File example, we will create the Workflow manually. To do so, Please navigate to Workflows Menu and select the Create option.
It opens the Create Workflow window. Please provide the unique name (wf_export_SQL_to_text) and leave the default settings.
Once we created the workflow, our next step is to create a session task for our mapping.
There are two types of sessions in Informatica:
For this Informatica Export Data from SQL Server to Flat File example, we created a Non-reusable Session. To create Non-reusable Session, Please navigate to Tasks Menu and choose the Create option.
Please provide a unique name for this session. Here, we are naming it as s_export_sql_to_text
Once you click on the Create button, a new window called Mappings will open. Here you have to select the mapping that you want to associate with this session i.e., m_export_sql_to_text.
Please link the Start Task and the Session Task.
Double click on the Session task will open the Edit Tasks window. Within Properties Tab, we have configured $Source connection value. This property will store the relational source information in the $Source variable.
So, click on the Arrow we marked above, and select the SQL Tutorial as the source information.
You can configure the Sessions Log properties, Error properties in Config Object
Within the mappings tab, we have to set the Source and Target Connections. First, let us configure the source connections by clicking on the SQ_Employe source present in the Sources folder.
With in the Connections, click on the Arrow button beside the Relational type, and Use Connection variable that we created earlier, i.e., $Source
Now, we have to configure the Target Connection. So, let us set the target connection by clicking on the Employetable present in the Targets folder.
If your requirement is Merging the data, use this Merge Type property. For now, we are leaving it to the No Merge option. I suggest you explore the remaining options.
Next, navigate to Workflows Menu and select the Validate option to validate the Workflow. Now, Let me start the Workflow by selecting the Start Workflow option in Workflows Menu.
Once you select the Start Workflow option, the Workflow monitor will open to monitor the workflow. From the below screenshot, see our Informatica Export Data from SQL Server to Flat File workflow is executed without any errors.
Let us open the default target location of the Informatica to check whether we successfully created a text file, and transfer the data from a source or not.
You can see the data inside the employee table text file.
Let me change the file location from Default Informatica destination to D folder, and also changing the name as employeetable. Next, Save and start the Workflow
Now you can see the employeetable.txt in D drive
In this article, we will show you how to Load Data From Text File to SQL Server in Informatica with an example. For this Informatica Load Data From Text File to SQL Server example, we are going to use the below show text file data (Employee table)
and the Destination table is File Destination. As you can see, it is an Empty table
Before we start configuring the Informatica to Load Data from Text File (or Flat File) to SQL Server. First, connect to Informatica repository service by providing the Informatica Admin Console Username and password you specified while installing the Informatica Server.
Please navigate to Source Analyzer to define your Sources. As we said before, we are using the Employee table present in the local File System as our source definitions. So, Please navigate to the Source menu and select the Import from File..
Once you select the Import from File.. option, a new window called Open Flat File will open. Please select the Employee.txt file from your local file system and click the Open button. I suggest you refer Flat File Source in Informatica article to under the following steps.
Once you click the Open button, a new pop up window called Flat File Import Wizard will open.
Step 2:
Here, we can edit the Column Name, Data type, Length or Precision, Scale, and Width. In general, we don’t do that, but if you want, you can do it.
From the below screenshot, you can see our newly created Flat File source in Informatica
Please navigate to Target Designer to define the Target. In this example, we are using the existing SQL table as our target definition. So, go to the Targets menu and select the Import from Database.. option.
Please select the ODBC connection that connects the Informatica with the SQLTest Database. To create a new one, please refer to the Informatica ODBC Connection article.
From the below screenshot, you can observe that we are selecting the File Destination table from our SQLTest database. You can refer to Create Target table using Source Definition to understand the target definition
Now you can see the target table with required column names.
To create a new mapping for Informatica Load Data From Text File to SQL Server, Please navigate to Mappings menu in Menu Bar, and select the Create.. option.
It opens the Mapping Name window to write a unique name for this mapping (m_load_text_to_SQL) and click OK button.
Drag and drop the Employee source definitions from the Flat File Sources folder to the mapping designer. Once you drag the source, the PowerCenter designer automatically creates the Source Qualifier Transformation for you.
Next, Drag and drop the target definition (File Destination) from Targets folder to the mapping designer. Next, connect the source qualifier with the target definition using the Autolink.. option.
Before we close the Mapping, Let us Save, and Validate the mapping by going to Mapping Menu bar, and select the Validate option.
After we finish creating the Mapping, we have to create the workflow for it. Power Center Workflow manager provides two approaches to create a workflow.
In this example, we will create the Workflow manually. To do so, Please navigate to Workflows Menu and select the Create option.
It opens the Create Workflow window. Please provide the unique name (wf_load_text_to_SQL) and leave the default settings.
Once we created the Informatica Load Data From Text File to SQL Server workflow, our next step is to create a session task for our mapping.
There are two types of sessions in Informatica:
For this Informatica Load Data From Flat File to SQL Server example, we created a Non-reusable Session. To create Non-reusable Session, Please navigate to Tasks Menu and select the Create option as shown below.
Please provide a unique name for this session (s_load_text_to_sql)
Once you click on the Create button, a new window called Mappings will open. Here select the mapping that you want to associate with this session, i.e., m_load_text_to_sql.
Please link the Start Task and the Session Task.
Double click on the Session task will open the Edit Tasks window. Within Properties Tab, we have configured the $Target connection value. This property stores the relational source information in the $Target variable.
So, click on the Arrow we marked above, and select the SQL Test as the target information.
Within the mappings tab, we have to configure the Source and Target Connections. First, let us set the Target connection by clicking on the FileDestination.
Within the Connections, click on the Arrow button beside the Relational type, and Use Connection variable that we created before, i.e., $Target
You can change the Target Load type from Bulk to Normal as per your requirement.
Now, we have to configure the Source Connection. Please click on the SQ_Employee present in the Sources folder.
Next, navigate to Workflows Menu and select the Validate option to validate the Workflow. Now, Let me start the Workflow by choosing the Start Workflow option in Workflows Menu.
Once you select the Start Workflow option, Workflow monitor opened to monitor the workflow. From the below screenshot, our Informatica Load Data From Text File to SQL Server workflow executed without any errors.
Let us open the SQL Server to check whether we successfully transfer the data from a source or not.
In this article, we will show you how to Load Multiple Text Files into SQL Server in Informatica with example. For this Informatica Load Multiple Text Files into SQL Server example, we are going to use Four Text files present in our local file system, i.e., D:\FILE SYSTEM TASK FOLDER\
Data present in the Employee1.txt file
Data present in the Employee2.txt file
Below screenshot will show you the data in the Employee3.txt file
Data present in the Employee4.txt file
Data in the Employee file
And the Destination table is Multiple File Destination. As you see, it is an Empty table
Before we start configuring the Informatica to Load Data from multiple Text Files (or Flat Files) to SQL Server. First, connect to Informatica repository service by providing the Informatica Admin Console Username and password you specified while installing the Informatica Server.
Once you connected successfully, Please navigate to Source Analyzer to define your Sources. To load data from multiple files, we have to provide the source definition that is common for all the text files. For this, we are using Employee1, but you can try any one (Employee2, 3, or 4).
To load the data present in our local file system, Please navigate to Source menu and select the Import from File.. option
Once you choose the Import from File.. option, a new window called Open Flat File opened. Please select the Employee1.txt file from your local file system. I suggest you refer Flat File Source in Informatica article to know the following steps.
Once you click the Ok button, a new pop up window called Flat File Import Wizard will open. Here, our text separated by comma delimiter, so we are selecting the Delimited option. Next, we check marked the Import filed names from the first line option. Because our text file contains column names as the first line
Under the Delimiter section, we are selecting Comma. And under the Text Qualifier section, we are selecting No quotes because our flat-file doesn’t have any quotes.
Here, we can edit the Column Name, Data type, Length or Precision, Scale, and Width. Please change the length, width, or scale as per your requirements.
From the below screenshot, you can see our newly created Flat File source in Informatica
Please navigate to Target Designer to define the Target. In this example, we use the existing SQL table as our target definition. So, go to the Targets menu and select the Import from Database.. option.
Please select the ODBC connection that will connect the Informatica with the SQL Test Database. To create a new one, please refer to the Informatica ODBC Connection article.
From the below screenshot, we are selecting the Multiple File Destination table from our SQL Test database. You can refer to Create Target table using Source Definition.
Now you can see the target table with required column names.
To create a new mapping, Please navigate to Mappings menu in Menu Bar, and select the Create.. option.
It opens the Mapping Name window to write a unique name for this mapping. Let me write m_load_multifiles_to_sql and click OK button.
Drag and drop the Employee1 source definitions from Sources folder to the mapping designer. Once you drag the source, the Power Center designer automatically creates the Source Qualifier Transformation for you.
Next, Drag and drop the target definition (Multiple File Destination) from Targets folder to the mapping designer. Next, connect the source qualifier with the target definition using the Autolink.. option.
Before we close the Mapping, Let us Save, and Validate the mapping by going to Mapping Menu bar, and select the Validate option.
After we finish creating the Informatica Load Multiple Text Files into SQL Server Mapping, we have to create the workflow for it. Power Center Workflow manager provides two approaches to create workflow.
In this example, we will create the Workflow manually. To do so, Please navigate to Workflows Menu and select the Create option.
It opens the Create Workflow window. Please provide the unique name (wf_load_multifiles_to_SQL) and leave the default settings.
Once we created the workflow, our next step is to create a session task for our mapping.
There are two types of sessions in informatica:
For this Informatica Load Multiple Text Files into SQL Server example, we are creating a Non-reusable Session. To create Non-reusable Session, Please navigate to Tasks Menu and select the Create option
Please provide a unique name (s_load_multifiles_to_sql) for this session.
Once you click on the Create button, a new window called Mappings will open. Here you have to select the mapping (i.e., m_load_multifiles_to_sql) that you want to associate with this session.
Please link the Start Task and the Session Task.
Double click on the Session task will open the Edit Tasks window. Within Properties Tab, we have configured the $Target connection value. This property stores the relational source information in the $Target variable.
So, click on the Arrow we marked above, and select the SQL Test as the target information.
Within the mappings tab, we have to configure the Source and Target Connections. First, let us set the Target connection by clicking on the FileDestination.
Within the Connections, click on the Arrow button beside the Relational type, and Use Connection variable that we created in our previous step, i.e., $Target
You can change the Target Load type from Bulk to Normal as per your requirement.
Now, we have to configure the Source Connection. Please click on the SQ_Employee1 present in the Sources folder. Please change the Source Filetype option from Direct to Indirect.
Next, navigate to Workflows Menu and select the Validate option to validate the Workflow. Now, Let me start the Workflow by selecting the Start Workflow option in Workflows Menu.
Let us open the SQL Server Management Studio to check whether we successfully transfer the data from multiple text files or not.
Let me alter the Employee text file. It means, Informatica has to load data from Employee1.txt file, and Employee4.txt file
Please checkmark the Truncate Target Table option to delete the existing records from the Target table, i.e., Multiple File Destination. I suggest you to refer SQL Truncate to understand the concept.
Let us open the SQL Server Management Studio. As you can see from the below screenshot, Informatica loaded the data from Employee 1 and Employee 4 text files.