View previous topic :: View next topic |
Author |
Message |
maverick05 Beginner

Joined: 15 May 2005 Posts: 72 Topics: 24
|
Posted: Tue May 19, 2009 1:33 pm Post subject: Low and High Timestamp Values |
|
|
Hi.
I need to default a value to time-stamp when no data is present.
Ex: Within a SQL query,
Varable1 BETWEEN X AND Y
Variable1 is a db2 column of type timestamp.So if i get values for x and y ,then my cursor works correctly.But if i dont get values for x and y,my cursor is failing.
So i moved low-values to x and high-values to Y.The cursor failed since i think low-values and high-values are used for alphanumeric variables only, whereas this variable1 is a db2 timestamp of X(26) length.
So is their any way to pass a default value to this variable apart from move certain specific dates to both X and Y? |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12380 Topics: 75 Location: San Jose
|
Posted: Tue May 19, 2009 3:01 pm Post subject: |
|
|
maverick05,
use the min and max values for a time stamp like this
Code: |
MOVE '0001-01-01-00.00.00.000000' TO X
MOVE '9999-12-31-00.00.00.000000' TO Y
|
Kolusu |
|
Back to top |
|
 |
NASCAR9 Intermediate
Joined: 08 Oct 2004 Posts: 274 Topics: 52 Location: California
|
Posted: Tue May 19, 2009 3:09 pm Post subject: |
|
|
kolusu you are too fast! maverick05 this is straight for the manual.
TIMESTAMP Timestamps. A timestamp is a seven-part value representing a date and time by year, month, day, hour, minute, second, and microsecond, in the range of 0001-01-01-00.00.00.000000 to 9999-12-31-24.00.00.000000. _________________ Thanks,
NASCAR9 |
|
Back to top |
|
 |
maverick05 Beginner

Joined: 15 May 2005 Posts: 72 Topics: 24
|
Posted: Wed May 20, 2009 7:53 am Post subject: |
|
|
Thank you all. |
|
Back to top |
|
 |
|
|