Product specifications

6.1.4 Schema detection
The Data Access layer provides the following methods for the schema detection of a CSV file:
no detection
automatic detection
use of a Data Definition Language (DDL) file
use of an SQLDDL file
You choose the method to apply to the files using the Schema Detection parameter in the connection
wizard. You can provide the schema by using schema files (DDL or SQLDDL). This can be helpful for
large and complex CSV files.
Files are analyzed in alphabetical order.
Note:
The first lines of a CSV file may contain comments and can be skipped using the Number of Comment
Lines in the Beginning parameter in the wizard.
No detection
The data access driver skips comment lines, analyzes the first line, and determines the number of
columns, but not the column types. All values are considered as strings, and column size is set to 255
characters, which corresponds to the standard length of the VARCHAR data type. A value that exceeds
255 is truncated. The columns can contain null values.
Automatic detection
Remember:
You cannot apply this method to files with fixed-length columns.
The data access driver analyzes well-formed CSV files and obtains the following information:
column names
In most cases, the first line contains column names. Otherwise, the driver generates column names
in the format col1, col2, …, coln.
column types
The driver finds column types by using predefined patterns and user settings for numerical, date
and time data types. If a column contains values of different types, the driver then considers column
values as strings.
column sizes
The column size depends on its type. For numerical values, the column size is the length of the
highest value in the range of the type. For the other values, this is the length of the longest string
value found during the detection.
2012-03-1566
Data access driver reference