SQL Statements for SQL Loader(3.0)
The format of the SQL statements differs depending on which database type you are using.
For PostreSQL, SAP HANA and SybaseIQ, the path to the file (stated as <path to file>
 in the code blocks below) can be entered in three different ways:
- Entering the path explicitly, e gÂ
'Users/mine/mypath'
- Stating the UDR field containing the path by enteringÂ
$(UDR.fullpath)
- Stating the MIM value containing the path, e gÂ
$(Source_Pathname)
 for the Disk agent
PostgreSQL
For server side loading (file resides in the server filesystem of the database)
COPY table_name [(column1,colunm2,...,columnN)] FROM <path to file> DELIMITER ',' csv;
Stating columns is optional.
Note!
PostgreSQL does not support remote file loading.
SAP HANA
For server side loading (file resides in the server file system of the database)
Create a control file containing code below (this example ctl file name is abc.ctl, abc.txt is the csv file):Â
import data into table SYSTEM."TEST_LOADER" from 'abc.txt' record delimited by '\n' fields delimited by ',' optionally enclosed by '"' error log 'abc.err'
Â
Run the workflow with the following command:Â
import from '/<path>/abc.ctl'
Note!
SAP HANA does not support remote file loading.Â
Sybase IQ
For server side loading (file resides in the server file system of the database)
LOAD TABLE TABLENAME (COLUMNNAME, COLUMNNAME2) USING FILE <path to file> FORMAT BCP ESCAPES OFF DELIMITED BY ','
Note!
The Sybase JConnect driver does not support remote file loading.