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.

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

40; comment = "Person's forename";}<br />

...<br />

];<br />

table.primaryKey.pkcolumns = ["Surname"];<br />

5. Open the CSV file, for example, TiCsv.csv in a text editor and enter some values, for example, the following<br />

lines.<br />

Meyer,Hugo<br />

Schmitt,Michael<br />

Foo,Bar<br />

6. Open the table-import model (TiModel.hdbtim) file that you just created and enter the following lines of<br />

text.<br />

listCsvFile csvFiles;<br />

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

7. Open the data definition file (TiData.hdbtid) file that you just created in the same package and enter the<br />

following lines of text.<br />

implements TiPackage:TiModel.hdbtim;<br />

csvFiles = ["TiPackage:TiCsv.csv"];<br />

8. Deploy the table import.<br />

a) Select the package that you created in the first step.<br />

b) Click the alternate mouse button and choose Commit.<br />

c) Click the alternate mouse button and choose Activate.<br />

You have imported data into the <strong>SAP</strong> <strong>HANA</strong> table using the table import feature.<br />

5.11 Using Imported Table Data in <strong>SAP</strong> <strong>HANA</strong><br />

Before you start, ensure that you have deployed a table import.<br />

Note: If you activate the files and then log on to the system using the <strong>SAP</strong> <strong>HANA</strong> studio, you do not have<br />

sufficient privileges to execute a SELECT statement on the table that was created. To be able to execute<br />

the select statement on the table that was created, execute the following statement using the SQL editor<br />

in the <strong>SAP</strong> <strong>HANA</strong> studio:<br />

call<br />

_SYS_REPO.GRANT_PRIVILEGE_ON_ACTIVATED_CONTENT('select','"::"','');<br />

1. In the <strong>SAP</strong> <strong>HANA</strong> studio, write a Select statement to view the imported data.<br />

For example:<br />

SELECT * FROM "TiPackage::TiTable";<br />

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

Setting Up the Persistence Model<br />

P U B L I C<br />

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

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

Saved successfully!

Ooh no, something went wrong!