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.

Note: The names used in the following task are for illustration purposes only; replace the names of<br />

schema, tables, files, and so on shown in the following examples with your own names.<br />

1. Create a root package for your table import application.<br />

In <strong>SAP</strong> <strong>HANA</strong> studio, open the <strong>SAP</strong> <strong>HANA</strong> Development perspective and perform the following steps:<br />

a) In the Navigator view, right-click the package in the package hierarchy where you want to create the new<br />

package for your table-import configuration and choose New > Package... .<br />

b) Enter a name for your package, for example TiPackage.<br />

Note: Naming conventions exist for package names, for example, a package name must not start<br />

with either a dot (.) or a hyphen (-) and cannot contain two or more consecutive dots (..). In<br />

addition, the name must not exceed 190 characters.<br />

a) Choose OK to create the new package.<br />

2. Create a set of table-import files.<br />

The following files are required for a table import scenario.<br />

○ The table-import data file, for example, TiData.hdbtid<br />

Links the CSV data files to the data field and thus the target tables via the model<br />

○ A table-import model, for example, TiModel.hdbtim<br />

Defines the data fields and import target tables of each data field<br />

○ A table import package, for example, TiPackage<br />

Contains all the artifacts you need to complete the table-import operation<br />

○ A CSV file, for example, TiCsv.csv<br />

Contains the data to be imported into the <strong>SAP</strong> <strong>HANA</strong> table<br />

○ A table definition, for example, TiTable.hdbtable<br />

Defines the structure of the target import table<br />

○ The schema definition, for example, TISCHEMA.schema<br />

Specifies the name of the schema in which the target import table is created<br />

○ An application-logic, for example, TiConsumerApp.xsjs<br />

Once all files are created, you can import data from a source file, such as a CSV file, into the desired table<br />

during a commit.<br />

3. Using any code editor, open the schema definition (TISCHEMA.schema) file that you just created and enter<br />

the name of the schema you want to apply.<br />

schemaname=TISCHEMA<br />

4. Open the table definition of the target import table (TiTable.hdbtable) file that you just created and enter<br />

86<br />

the following lines of text.<br />

table.schemaName = "TISCHEMA";<br />

table.tableType = COLUMNSTORE;<br />

table.columns =<br />

[<br />

{name = "Surname"; sqlType = VARCHAR; nullable = false; length =<br />

40; comment = "Person's surname";},<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!