Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

How to use GENERATE ALWAYS AS in artifact?

$
0
0

I've created an hdbtable artifact witht the following definition:

 

table.schemaName = "MYSCHEMA";
table.tableType = COLUMNSTORE;
table.description = "Demo";
table.columns = [
 {name = "DriverId"; sqlType = INTEGER; nullable = false; comment = "Driver ID";},
 {name = "DriverName"; sqlType = NVARCHAR; nullable = false; length = 50; comment = "Driver Name";},
];
table.primaryKey.pkcolumns = ["DriverId"];

 

I want to add another column of type TIMESTAMP and want it to have a default value of CURRENT_TIMESTAMP whenever you change the row. I can't seem to figure out how to do that in my hdbtable artifact

 

Basically I'm looking to do the same thing as this SQL statement:

 

CREATE COLUMN TABLE DRIVERS (  DriverId INTEGER NOT NULL,  DriverName NVARCHAR(50) NOT NULL,  last_modified TIMESTAMP GENERATED ALWAYS AS CURRENT_TIMESTAMP NOT NULL,  PRIMARY KEY (DriverId)
);

 

Can anyone please help me out? Thx!


Viewing all articles
Browse latest Browse all 6412

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>