Create a new virtual table in db/data
.
Call it vt_salary_data
and flag Generate configuration file
Fill the Properties as follows:
- Remote Source Name:
LocalFile
- Database and Schema name:
<NULL>
- Object Name:
salarydata
Save and open the File Format Editor
Here you can adapt the inbound file format. Change Skipped Header Lines to 1.
Copy the following lines to the simulation and run it. These have been taken from the salarydata.csv
file
ID,SALARY,START_YEAR,GENDER,REGION,T-LEVEL
100001,139171,1998,m,APJ,T5
Use the Copy function and then use the pencil to edit the data types
Change the types as follows:
Save and Build the database module
As a reference, here is the code for the virtual table. You can access this mode by right-clicking on the virtual table artifact and choosing Open Code Editor.
VIRTUAL TABLE "vt_salary_data" AT "LocalFile"."<NULL>"."<NULL>"."salarydata"
REMOTE PROPERTY 'dataprovisioning_parameters'='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Parameters>
<Parameter name="FORMAT">CSV</Parameter>
<Parameter name="FORCE_FILENAME_PATTERN">%.csv</Parameter>
<Parameter name="PARTITIONS">0</Parameter>
<Parameter name="CODEPAGE">utf-8</Parameter>
<Parameter name="LOCALE">en_US</Parameter>
<Parameter name="SKIP_HEADER_LINES">1</Parameter>
<Parameter name="ROW_DELIMITER">\n</Parameter>
<Parameter name="QUOTED_TEXT_CONTAIN_ROW_DELIMITER">false</Parameter>
<Parameter name="COLUMN_DELIMITER">,</Parameter>
<Parameter name="EXPONENTIAL">E</Parameter>
<Parameter name="LENIENT">true</Parameter>
<Parameter name="COLUMN">ID;INTEGER;</Parameter>
<Parameter name="COLUMN">SALARY;FLOAT;</Parameter>
<Parameter name="COLUMN">START_YEAR;INTEGER;</Parameter>
<Parameter name="COLUMN">GENDER;NVARCHAR(1);</Parameter>
<Parameter name="COLUMN">REGION;NVARCHAR(4);</Parameter>
<Parameter name="COLUMN">T-LEVEL;NVARCHAR(200);</Parameter>
</Parameters>';