Skip to Content
1
Jul 31, 2013 at 10:24 PM

How to use GENERATE ALWAYS AS in artifact?

409 Views

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!