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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Browse to the folder in your project workspace where you want to create the new sequence-definition file and<br />

perform the following tasks:<br />

a) Right-click the folder where you want to save the sequence-definition file and choose New in the contextsensitive<br />

popup menu.<br />

b) Enter the name of the sequence in the File Name box and add the file suffix .hdbsequence, for example,<br />

MYSEQUENCE.hdbsequence.<br />

c) Choose Finish to save the new sequence in the repository.<br />

5. Define the sequence properties.<br />

To edit the sequence file, in the Project Explorer view double-click the sequence file you created in the<br />

previous step, for example, MYSEQUENCE.hdbsequence, and add the sequence code to the file:<br />

schema= "TEST_DUMMY";<br />

start_with= 10;<br />

maxvalue= 30;<br />

nomaxvalue=false;<br />

minvalue= 1;<br />

nominvalue=true;<br />

cycles= false;<br />

reset_by= "SELECT \"Col2\" FROM \"TEST_DUMMY\".<br />

\"com.sap.test.tables::MY_TABLE\" WHERE \"Col2\"='12'";<br />

depends_on_table= "com.sap.test.tables::MY_TABLE";<br />

6. Save the sequence file.<br />

7. Commit the changes to the repository.<br />

a) Locate and right-click the new sequence file in the Project Explorer view.<br />

b) In the context-sensitive pop-up menu, choose Team Commit .<br />

5.7 SQL Views<br />

In SQL, a view is a virtual table based on the dynamic results returned in response to an SQL statement. Every<br />

time a user queries an SQL view, the database uses the view's SQL statement to recreate the data specified in the<br />

SQL view. The data displayed in an SQL view can be extracted from one or more database tables.<br />

An SQL view contains rows and columns, just like a real database table; the fields in an SQL view are fields from<br />

one or more real tables in the database. You can add SQL functions, for example, WHERE or JOIN statements, to a<br />

view and present the resulting data as if it were coming from one, single table.<br />

<strong>SAP</strong> <strong>HANA</strong> Extended Application Services (<strong>SAP</strong> <strong>HANA</strong> XS) enables you to create a database view as a design-time<br />

file in the repository. Repository files can be read by applications that you develop. In addition, all repository files<br />

including your view definition can be transported to other <strong>SAP</strong> <strong>HANA</strong> systems, for example, in a delivery unit.<br />

If your application refers to the design-time version of a view from the repository rather than the runtime version<br />

in the catalog, for example, by using the explicit path to the repository file (with suffix), any changes to the<br />

repository version of the file are visible as soon as they are committed to the repository. There is no need to wait<br />

for the repository to activate a runtime version of the view.<br />

To define a transportable view using the design-time view specifications, use the configuration schema illustrated<br />

in the following example:<br />

string schema;<br />

string query;<br />

80<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!