Product specifications

6.1.3 Table mapping
The data access driver exposes CSV files as tables to the information design tool.
You can connect to multiple files if the Filepath or Pattern parameter of the connection wizard is set
to a pattern, for example report_*.csv, which is matched by files such as report_2010-09-22.csv
and report_2010-09-21.csv.
The driver applies one of the following processes:
If the Union to One Table parameter is selected in the connection wizard, all CSV files are mapped
to one single table. It is assumed they all have the same schema. This is the default behavior of the
data access driver.
If the parameter is not selected, each CSV file is mapped to a different table.
Mapping all files to one table
The table name is the name of the pattern, for example report_*.csv. The table has an additional
column named sourcefile, which contains the name of the source file for each table row.
If you use an SQLDDL file to provide the schema, the table name must also be the pattern.
If the files have different column names, the column names of the resulting table are the ones of the
first file analyzed by the driver, knowing that the files are analyzed in alphabetical order.
Mapping one file to one table
The name of each table corresponds to the file name of its data source.
If you use an SQLDDL file to provide the schema, the name of the table in the CREATE statement must
be the file name.
Note:
Independently of the parameter value, the file path is mapped to the qualifier of the table.
Example: Column names
If the report_1.csv file has the col1, ..., and col10 columns, while the report_2.csv file has
the column1, ..., and column10 columns, then the columns of the resulting table are col1, ..., and
col10.
Example: Qualifier
If C:\reports\report_1.csv is the data source, then the qualifier is C:\reports\ and the table
name is report_1.csv.
2012-03-1565
Data access driver reference