Board index » database » Time functions in db2

Time functions in db2

2004-10-29 06:21:38 PM
Hello,
I need to transfer stored procedures from SAPDB to DB2. In one of the
functions a addtime function is called
timestamp=addtime(timestamp ts,varchar(10) timespan)
The timespan string get converted to time value and is added to the
timestamp.
Is there a way to do this in DB2? And how?
Thanks in advance.
Greetings, Jan
-
 

Re:Time functions in db2

"Jan Suchanek" <jan.suchanek@gmx.de>wrote in message
Quote
Hello,

I need to transfer stored procedures from SAPDB to DB2. In one of the
functions a addtime function is called

timestamp=addtime(timestamp ts,varchar(10) timespan)

The timespan string get converted to time value and is added to the
timestamp.
Is there a way to do this in DB2? And how?

Since you haven't specified your platform and version, we can't answer your
question directly. However, the SQL Reference for each platform and version
of DB2 specifies the functions that are available for manipulating
timestamps. If you haven't actually installed DB2 and its documentation yet,
all of the manuals for all of the recent versions of DB2 for each platform
are available online at the IBM website.
Rhino
-

Re:Time functions in db2

Jan Suchanek <jan.suchanek@gmx.de>wrote in message news:<418219b2$1@news.uni-ulm.de>...
Quote
Hello,

I need to transfer stored procedures from SAPDB to DB2. In one of the
functions a addtime function is called

timestamp=addtime(timestamp ts,varchar(10) timespan)

The timespan string get converted to time value and is added to the
timestamp.
Is there a way to do this in DB2? And how?

What is the format of timespan? hh:mm:ss? or other?
-

Re:Time functions in db2

Hello,
Tokunaga T. wrote:
Quote
Jan Suchanek <jan.suchanek@gmx.de>wrote in message news:<418219b2$1@news.uni-ulm.de>...

Quote
Hello,

I need to transfer stored procedures from SAPDB to DB2. In one of the
functions a addtime function is called

timestamp=addtime(timestamp ts,varchar(10) timespan)

The timespan string get converted to time value and is added to the
timestamp.
Is there a way to do this in DB2? And how?


What is the format of timespan? hh:mm:ss? or other?
At teh moment it is in fact hhmmss (without the ":"). But a little
"interview" with our application developers revealed that they could
give me an other format too. So now it seem that I cann get a timestamp
in a decimal format and therefor simple can add (+) the timestamp
(timespan) to the current time (current timestamp).
I just wonder if the is a more comfortable way to do it (liek addtime in
SAPDB or dateadd in MSSQL)...
Greetings, Jan
BTW: I am using DB2 Version 8.2 on a Linux system
-