28.01.2013 Views

SAP HANA Developer Guide - Get a Free Blog

SAP HANA Developer Guide - Get a Free Blog

SAP HANA Developer Guide - Get a Free Blog

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

}<br />

];<br />

5.9.3 Table-Import Extensions<br />

The table-import feature enables you to modify the initial settings for variables defined in table-import<br />

configuration files by specifying new settings for defined variables in separate extension files.<br />

If both a table-import model and a table-import data file exist, then you can modify initial variable assignments<br />

made in one table-import data file in a subsequent table-import data files (so called extensions) - as long as the<br />

variables are not declared explicitly as final in a previous file. The modification takes place only on the data values<br />

of variables, for example, in a table-import-extension data file, where values can be augmented or be replaced.<br />

The result is a chain of table-import data artifacts. The end result of a successful table import operation is based<br />

on the resulting definition of the file-list parameter as a result of all data files in the chain.<br />

Note: You can only create a linear chain of extensions. It is not permitted to create two table import data<br />

files modifying the same base table import data files.<br />

The following example illustrates a simple table-import model named timodel.hdbtim in the package<br />

TiPackage.<br />

csvFileList csvList;<br />

import csvList "TISCHEMA" "TiPackage::TiTable";<br />

The following example illustrates the contents of a simple table-import data file named tidata.hdbtid, which<br />

implements the table-import model defined in timodel.hdbtim illustrated above.<br />

implements TiPackage:timodel.hdbtim;<br />

csvList = ["TiPackage:mydata.csv"];<br />

The following example illustrates how to extend the definition in the table-import data file tidata.hdbtid<br />

illustrated above.<br />

modifies sap.myPackage:tidata.hdbtid;<br />

csvList = csvList + ["TiPackage:myotherdata.csv"];<br />

After activation of the table-import files, the data from both CSV files (TiPackage:mydata.csv, and<br />

TiPackage:myotherdata.csv) is imported into the target table.<br />

5.9.4 Table-Import Configuration-File Syntax<br />

When you define the details of the table-import operation, you use the following file-list types to enable the<br />

processing of certain data formats:<br />

● csvFileList<br />

Used to specify list of comma-separated values (CSV) file links. The linked CSV files are imported into the<br />

target table specified in the table import model. The import process parses and validates the CSV file format.<br />

● csvFileListExt<br />

84<br />

Similar to (but more flexible than) csvFileList since more settings are possible. You must specify the target<br />

table and the destination file list of CSV files, which is also extendable. For each CSV file it is possible to define<br />

the following additional options:<br />

○ If a header is given or not<br />

○ Which delimiter is use to separate the CSV data<br />

P U B L I C<br />

© 2012 <strong>SAP</strong> AG. All rights reserved.<br />

<strong>SAP</strong> <strong>HANA</strong> <strong>Developer</strong> <strong>Guide</strong><br />

Setting Up the Persistence Model

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!