cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Sequence in HANA CDS

former_member252769
Active Participant
0 Kudos
1,068

Hi Experts,

We are in a process of DB2 to HANA CDS migration.

In one of the DB2 table we had used unique number generator but while converting the same table to HANA CDS how we can write in HANA CDS syntax.

DB2 DDL:

CREATE TABLE "DB2"."HEADER"  (

   "ID" DECIMAL(15,0) NOT NULL GENERATED ALWAYS AS IDENTITY ( 

     START WITH +1 

     INCREMENT BY +1 

     MINVALUE +1 

     MAXVALUE +999999999999999 

     NO CYCLE 

     CACHE 20 

     NO ORDER ) ,

   "SYSTEM_ID" VARCHAR(10) ,

   "CRE_TME" TIMESTAMP ,

   "MOD_TME" TIMESTAMP ,

   "ERR_FLAG" CHAR(1) )  

  IN "DB2" ;

HANA CDS code:

ENTITY HEADER  {

  ID : Decimal(15,0) NOT NULL ; 

  SYSTEM_ID : String(10) ;

  CRE_TME : UTCTimestamp ;

  MOD_TME : UTCTimestamp ;

  ERR_FLAG : String(1) ; } 

How I can use sequencer for field ID at the table definition level in HANA CDS.

Regards

BJ

View Entire Topic
thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

This feature is not yet support in HANA CDS.  For a work around please use a sequence within the INSERT statements.

former_member252769
Active Participant
0 Kudos

Thanks Thomas for confirming....
Also, please can you point me to any docs for advantages of using HANA CDS over normal catalog objects in HANA.