Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

Hi, Please help me to write a query to insert timestamp value to Sybase table using insert query.

Regards, Bikshu.

asked 08 Oct '13, 00:48

bikshu's gravatar image

bikshu
30112
accept rate: 0%

5

As this is more like a Read the Manual stuff. You will have tried something and it did not work. Show what you have tried to do and give the volunteer a idea what you would like to accomplish.

(08 Oct '13, 02:14) Thomas Dueme...

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.

permanent link

answered 08 Oct '13, 09:00

JBSchueler's gravatar image

JBSchueler
3.3k41564
accept rate: 19%

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.

permanent link

answered 08 Oct '13, 09:04

Chris%20Keating's gravatar image

Chris Keating
7.8k49128
accept rate: 32%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×34

question asked: 08 Oct '13, 00:48

question was seen: 18,910 times

last updated: 08 Oct '13, 09:04