cancel
Showing results for 
Search instead for 
Did you mean: 

Table type creation via HS repository / CDS / DDl Source

Former Member
0 Kudos

Hi,

Can we create table types via the repository / DDL source files? I see examples on actual table creations. But what about table types? Is this only possible via SQL console?

Regards,

Nehal.

Accepted Solutions (1)

Accepted Solutions (1)

former_member182302
Active Contributor
0 Kudos

Hi Nehal,

You can create using HDBDD

@Catalog.tableType : #COLUMN

Did you have a look on page  182 in dev guide?


namespace com.acme.myapp1;

@Schema : 'MYSCHEMA'

@Catalog.tableType : #COLUMN

@Catalog.index : [ { name : 'MYINDEX1', unique : true, order :#DESC, elementNames :

['ISBN'] }  ]

entity MyTable {

    key Author    : String(100);

    key BookTitle : String(100);

};

ISBN      : Integer not null;

Publisher : String(100);

Regards,

Krishna Tangudu

Former Member
0 Kudos

Hi Krishna,

I did notice this code yes. But is this not the code to create a column table and not a table type?

Regards,

Nehal.

former_member182302
Active Contributor
0 Kudos

Ho Sorry my bad yes you are correct.

Refer to Page no: 186


namespace com.acme.myapp1;

@Schema: 'MYSCHEMA' // Structured types

type Type1 {

Fstr:       String( 5000 );

Flstr:      LargeString;

Fbin:       Binary( 4000 );

Flbin:      LargeBinary;

Fint:       Integer;

Fint64:     Integer64;

Ffixdec:    Decimal( 34, 34 );

Fdec:       DecimalFloat;

Fflt:       BinaryFloat;

Flocdat:    LocalDate;

Floctim:    LocalTime;

Futcdatim:  UTCDateTime;

Futctstmp:  UTCTimestamp;  };

You can also use .hdbstructure to create a table types

Regards,

Krishna Tangudu

Former Member
0 Kudos

Thanks Krishna, this looks like it will work.

Answers (0)