TV 3.7.0
If a file such as csv, json or parquet should be loaded into a TSA table the following guide should be followed step by step.
First a bdomain has to be added. This can be done by following the first chapter of this HowTo Guide:
After following this guide a bdomain with the name 'TESTING' has been created. If the creation was successful can be checked by going to the table REDADM.RED_BDOMAINS and look for an entry with this name in the field 'BDOMAIN'.
After a bdomain has been added, CFI bdomain settings have to be added. This can be achieved by following the first chapter of the HowTo Guide Add BDomain Settings.
The settings can be checked in the table CFIADM.CFI_BDOMAIN_SETTINGS.
The next step is to add a loader. A loader can be added by following the first chapter of the HowTo Guide below.
To check if the loader was added, one can check the table CFIADM.CFI_LOADER for an entry with the name 'PERSON'.
After a bdomain has been successfully created and settings have been added and a loader was created as well, the bdomain specific metadata and loader have to be connected. This can be done by following the first chapter of the following HowTo Guide:
The result of following the guide before is an entry in the table CFIADM.CFI_LOADER_BD for the loader 'PERSON' with the bdomain 'TESTING'.
If a bdomain has been successfully connected with a loader, a loader for each of the source columns can be added. This can be achieved by following the first chapter of the following HowTo Guide, with some little adjustments. These adjustments are necessary to be able to run this example with the test csv file provided.
The column 'Salary' has to get the column position 4 and 'Birthday' the column position 5 and the following script has to be issued additionally so a column 'LastName' on position 3 is added:
EXECUTE SCRIPT API_CFIADM.ADD_LOADER_BD_COLUMN(
'PERSON' -- p_ldr_name
,'TESTING' -- p_bdomain
,'LastName' -- p_col_name
,'varchar' -- p_col_data_type
,100 -- p_col_size
,null -- p_col_scale
,null -- p_col_format
,3 -- p_col_pos
,null -- p_col_fbv_size
,null -- p_col_fbv_start
,null -- p_col_fbv_align
,null -- p_col_fbv_padding
);
After following the guide above while also following the adjustments, five entries will have been added to the table CFIADM.CFI_LOADER_BD_COLUMNS one for each column.
Now that all prerequisites are successfully created, a TSA table can be created by providing the name of the loader and of the bdomain to the script API_CFIADM.CREATE_TSA_TABLES as can be seen in the example below.
EXECUTE SCRIPT API_CFIADM.CREATE_TSA_TABLES(
'PERSON' -- p_ldr_name
,'TESTING' -- p_bdomain
);
This creates a table from the metadata provided before and adds technical columns as well. The table can be found as CFITSA.TEST_PERSON.
TIPP: If one has created various loaders and wants to create a TSA table for each of them, one can provide two null values to the API_DBIADM.CREATE_TSA_TABLES function and the function will automatically create a TSA table for each new loader.
After the table has been created, data can be added to the table, by uploading the file.
ATTENTION: When uploading a file add a .tra at the end of the file to prevent unfinished files from being loaded. Make sure that redsys is the owner of the file and that the complete file has been uploaded before removing the .tra ending. If the file is loaded without any errors it can be found in the archive folder, otherwise it will be moved to the error folder as explained here.
The table is being reloaded by simulating new data entries by raising the timestamp of the entries in the source file.