Home
SQL File Import online help Prev Page Prev Page
Introduction
About SQL File Import
Version history
Contact us
Supported database engines
Using SQL File Import
Home page
Task Wizard
Select source data
Files as source data
CSV source data files
Excel source data files
Enter file search patterns
Connect to database
Conecting to databases directly without client libraries installed
Connecting to an Oracle database
Database scripts
Select table to upload into
Map data to table columns
Review script results
Transaction options
Logging options
Finalise
Run task
Scheduling a task
Options
Scripting
Global variables
OnBeforeUpload function
OnAfterUpload function
Support functions
Data functions
Log functions
String functions
Date and time functions
Date-Time format strings
File functions

CSV source data files

SQL File Import can use text files to import data into your table. Plain text files are supported, as are UTF-8 and UTF-16 encoded files. UTF-8 encoded files must begin with the byte order marker 0xEF,0xBB,0xBF. UTF-16 encoded files must begin with the byte order marker 0xFF,0xFE.

This is the sample CSV file used in demo 4

source_text_01  
 
The first line must contain the source column names, separated by commas. Subsequent lines represent the data rows. Each row may contain values for each of the source columns. Values containing spaces or commas must be enclosed in double quotes.

If you want to upload data that is derived from other column's values, you can use dummy columns to act as a placeholder for the value. For e.g. in demo 3, we have defined the following the CSV source file:

source_text_02  

The size
and contents columns do not contain any value, and will use scripts to populate values into them. The final mapping of the columns would look like this:

source_text_03  
The values for the size column is generated dynamically using the value from the filename column in this way:

source_text_04  
 
and the contents column, which is used to upload the contents of the file name specified in the filename column, uses the following script:

source_text_05  

The CSV file name can include wildcard characters (* or ?). When wildcard characters are detected, SQL File Import will use the entered file name as a search pattern and look for files matching that search pattern. The list of files is then sorted in alphabetical order, and the first file is used as the source CSV file.