Hi, Please help me to write a query to insert timestamp value to Sybase table using insert query.
asked 08 Oct '13, 00:48
Here you go.
create table ts_table (ts timestamp); insert into ts_table (ts) values ('2013-10-08T12:34:45.678');
Of course, I am sure that's not what you wanted to know, but it is what you asked.
answered 08 Oct '13, 09:00
This assumes that you are asking about SQL Anywhere and not ASE. If you are asking about timestamps in ASE, you should ask that in an ASE focused forum.
For SQL Anywhere, here is a simple example:
insert into t (ts_col) values( now() )
For ASE, you should note that a timestamp value is not a data and time value but a binary value generally used for row versioning. Its value is updated anytime a row is modified so that suggests that you likely should not be setting its value at all in a row operation - simply let the server manage that for you. You can obtain the timestamp value with @@dbts. If you are asking in an ASE context, I remind you that I am not an ASE person so you should address this in a forum that is focused on ASE.
answered 08 Oct '13, 09:04