TrustyCoder
TrustyCoder

Reputation: 4789

is it possible to explicity insert values in timestamp column of DB2

is it possible to explicity insert values in timestamp column of DB2? For example i have a date time value '2\11\2005 4:59:36 PM'. How to convert it to timestamp value in DB2?

Thanks in advance

Upvotes: 6

Views: 26830

Answers (2)

Amit M
Amit M

Reputation: 61

Another way to specify insert into timestamp field:

insert into mytable (timestamp_field, ...) values ('2018-07-25-14.56.11.000000', ...)

Upvotes: 6

TrustyCoder
TrustyCoder

Reputation: 4789

INSERT INTO TimeStampTable(TIMESTAMPFIELD, ...) 
VALUES ((TIMESTAMP(CAST('04.02.2005' AS VARCHAR(10)),'13:14:53')),...)

Upvotes: 5

Related Questions