Configuration Parameters
This section contains the information that the connector uses to connect and interact with the application. Each application type requires different information to create and maintain a connection.
The SQL Loader connector uses the following connection attributes under different tabs (Settings, Merging, and Iteration Partitioning):
Note
Attributes marked with an asterisk (*) are mandatory.
SQL Loader Connection Settings
The user with which to connect to the host to access the files placed on FTP, SFTP, HTTP, or HTTPS server.
The password associated with the specified user.
Enter the URL of Data Files.
For more information of the examples for different types of servers, refer to Examples for Data Files URL.
Enter the default JDBC driver class path provided as follows:
com.hxtt.sql.text.TextDriver
Parameters to be passed in the form of key value pair, if multiple parameters must be specified, then they must be passed in the new line in the following format:
-
_CSV_Header=true
: Adding this additional connection parameter would treat the first record of Data File as header. -
_CSV_Separator=,
: Here comma is record separator. -
csvfileExtension=txt
: Use this additional connection parameter when data file extension is .txt.
For example,
_CSV_Header=true
_CSV_Separator=,
csvfileExtension=txt
For more information, refer to Additional Connection Parameters Information.
Query Settings
The SQL attribute can be used to customize the select statement that is generated when iterating over objects. You can specify the exact SQL that is executed if you want to filter out objects or only want to select a few objects from a table. Additionally, if you want to perform joins between more then one table, it is impossible to describe with the schema alone.
By default, if the SQL option is null when the query string is built using the schema attributes and nativeObjectType.
The object SQL statement.
Use Statement.executeQuery()
instead of the default Statement.execute()
.
Enable this option to execute the query for direct permission.
Direct Permission Execute Query is used to retrieve the direct permission data from permission file. Permission file should contain at least Identity attribute column. The permission data is retrieved by referring the identity attribute in the column at the time of aggregation through main SQL query in which the identity attribute is mentioned.
Note
Query must be written in such a way that ResultSet data must contain first column as Target, second column as Permission, and third column as annotation (optional).
For example:
SELECT column4 AS TARGET, column5 AS PERMISSION FROM Permission p WHERE CONCAT(TRIM(CONCAT(p.column1,'\ ')), TRIM(p.column2)) = '$(identity)';
Here, the file name is Permission.csv
and $(identity)
is an Identity attribute.
Merging
Select this option if the data for a single object spans multiple lines.
This option enables the connector to verify the order of the data returned from the database when merging to prevent data loss. When merging, it is very important to have the ORDER BY clause in your SQL statement to prevent out of order errors.
Name of the index column that will be used when finding like objects in the dataset.
Names of the columns from the file from which values must be merged.
Note
You must discover the schema to get the suggested column values in index and merge columns for selection. Discover schema populates the values in a multi-suggest attribute dropdown of index and merge columns which have the auto complete facility.
Iteration Partitioning
Select this checkbox to configure and enable partitioning.
Enter the list of SQL statements that must be executed when partitioning. The statements must include all of the rows and each line/statement so it can be proceeded in separate threads and/or multiple hosts.
For more information, refer to Partitioning Aggregation.
Examples for Data Files URL
Server |
Examples |
|
Local |
Windows |
UNIX |
For mapped drive/shared location: |
|
|
|
Text |
CSV |
FTP Server |
|
|
SFTP Server |
|
|
HTTP Server |
|
|
HTTPS Server |
|
|
Examples for Query Settings
For the Query Settings fields, see the following example:
Join Query: If the .CSV files have the following respective columns:
-
Employee.CSV: ID, FullName, Email, and ContactNo
-
EmpDept.CSV: ID, DeptName, and Role
Then to aggregate data from Employee.CSV and EmpDept.CSV files, the join query is as follows:
select e.ID, e.FullName, e.Email, e.ContactNo, d.DeptName, d.Role
from Employee e , EmpDept d
where e.ID=d.ID
Note
When the file name is Employee.CSV, in SQL query, you must only mention Employee, '.csv' is not required.