This repository has been archived by the owner on Aug 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
Parser hdbsequence
LiliyaLazarova edited this page Sep 28, 2021
·
11 revisions
The information on how to develop the design-time data-persistence model for an XSK application using the HDBSequence syntax
- SAP Help
- Sample Hana XS Classic syntax:
schema= "TEST_DUMMY";
start_with= 10;
maxvalue= 30;
nomaxvalue=false;
minvalue= 1;
nominvalue=true;
cycles= false;
reset_by= "SELECT T1.\"Column2\" FROM \"MYSCHEMA\".\"com.acme.test.tables::MY_TABLE1\" AS T1 LEFT JOIN \"MYSCHEMA\".\"com.acme.test.tables::MY_TABLE2\" AS T2 ON T1.\"Column1\" = T2.\"Column1\"";
depends_on=["com.acme.test.tables::MY_TABLE1", "com.acme.test.tables::MY_TABLE2"];
- Sample Hana XS Advanced syntax
SEQUENCE "com.sap.hana.example::CUSTOMER_ID"
RESET BY
SELECT IFNULL(MAX(ID), 0) + 1 FROM "com.sap.hana.example::CUSTOMERS"
- Configuration Schema
Name | Description | Type | Default value | Required |
---|---|---|---|---|
schema | Name of the schema that contains the sequence you are defining. | String | None | Yes |
increment_by | Specify that the sequence increments by a defined value. | Integer | 1 | No |
start_with | Specify that the sequence starts with a specific value. Cannot be less than the minvalue. | Integer | 1 | No |
maxvalue | Specify that the sequence stops at a specific maximum value. | Integer | Different for each DB | No |
nomaxvalue | Specify that the sequence does not stop at any specific maximum value. | Boolean | False | No |
minvalue | Specify that the sequence stops at a specific minimum value. | Integer | 1 | No |
nominvalue | Specify that the sequence does not stop at any specific minimum value. | Boolean | false | No |
cycles | Enables you to specify whether the sequence number will be restarted after it reaches its maximum or minimum valueg. | Boolean | None | No |
reset_by | Enables you to reset the sequence using a query on any view, table or even table function. However, any dependency must be declared explicitly, for example, with the depends_on_view or depends_on_table keyword. If the table or view specified in the dependency does not exist, the activation of the sequence object in the repository fails. | String | None | No |
public | Specifies if it is public or not. | Boolean | False | No |
depends_on_table | Enables you to define a dependency to one or more specific tables. | List(String) | None | No |
depends_on_view | Enables you to define a dependency to one or more specific views. | List(String) | None | No |
depends_on | Enables you to define a dependency to one or more specific tables or views, for example when using the reset_by option to specify the query to use when resetting the sequence. | List(String) | None | No |
- Issues
-
Parser behaviour Parser is independent from properties order. However, exception will be thrown if one property is defined more than once in the *.hdbsequencefile. Also, additional exception will be thrown in case a mandatory field is missing. Parser would not care about depends_on, depends_on_view, depends_on_table properties due to the fact HANA XS Advanced handles sequences as expected with reset_by being provided and depends_on_ fields are not.
-
Samples
- Modules
- Unit Tests
- Integration Tests