on 2013 Oct 08 1:48 AM
Hi, Please help me to write a query to insert timestamp value to Sybase table using insert query.
Regards, Bikshu.
Request clarification before answering.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
39 | |
15 | |
9 | |
7 | |
5 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.