on 09-25-2015 6:15 PM
Anyone can hint me what is the correct syntax to set dedault value of a timestamp field to current time?
table.columns = [
{ name = "TIMESTAMP"; sqlType = TIMESTAMP; nullable = false; defaultValue="current_timestamp()"; },
{ name = "USAGE"; sqlType = INTEGER; nullable = false; }
];
Thanks!
Yue
You can not use SQL Functions in such a way in HDBTABLE. However you can use them as of SPS 10 in HDBDD table definitions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Yue,
You cannot set current_timestamp or now() as a defaultValue to TIMESTAMP datatype. Infact defaultValue cannot for used for TIMESTAMP datatype. Incase you need the current time then use these functions in your SQL Script
Below is the Column Definition that we can use for .hdbtables:
struct ColumnDefinition {
string name;
SqlDataType sqlType;
optional bool nullable;
optional bool unique;
optional int32 length;
optional int32 scale;
optional int32 precision;
optional string defaultValue;
optional string comment;
};
-Avinash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.