RE: TIMESTAMP_ISO

RE: TIMESTAMP_ISO

 

  

Wrong function for this job, try the TIMESTAMP scalar function instead:

db2 "create table t1(c1 date, c2 time, c3 timestamp)"
db2 "insert into t1(c1,c2) values(current date, current time)"
db2 "update t1 set c3 = timestamp(c1,c2)"

... as simple as that.
Best Regards
Alex Levy
Sustainable Software Lrd.

-----Original Message-----
From: Joanna Grossman
[mailto:db2udbdba-ezmlmshield-x19497095.[Email address protected]
Sent: 25 March 2008 14:11
To: LazyDBA Discussion
Subject: TIMESTAMP_ISO

Okay, here's a follow-up to my last question. I've got a TIME field and a
DATE field in my raw data. I'd like to derive a TIMESTAMP field upon INSERT
from these two fields. This seems like it should be obvious, but I can't
figure the syntax. It should be something like:

INSERT INTO TABLE
(TIME, DATE, TIMESTAMP)
VALUES
(TIME('01.00.00'), date('2006-05-06'), TIMESTAMP_ISO(DATE,TIME) );

but that's not it. And the documentation says it will only take one of the
other, but there's not much point in a timestamp unless it can accept both
time and date, right?

TIA


---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY To post a dba
job: http://jobs.lazydba.com To Subscribe : http://www.LazyDBA.com To
unsubscribe: http://www.lazydba.com/unsubscribe.html






E-mail message checked by Spyware Doctor (5.5.0.212) Database version:
5.09480 http://www.pctools.com/en/spyware-doctor/





E-mail message checked by Spyware Doctor (5.5.0.212)
Database version: 5.09480
http://www.pctools.com/en/spyware-doctor/

DB2 & UDB email list listserv db2-l LazyDBA home page