IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Default values for Timestamp


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rsm_deepak

New User


Joined: 06 Apr 2005
Posts: 30
Location: visakhapatnam

PostPosted: Thu Aug 07, 2008 1:59 pm
Reply with quote

I have a added a new column name with the type Timestamp(neither create nor updated - it is just a time its opertated based on when the decision took) in my table.

If I get the value i will insert it.

The question started what if I won't get a value of the timestamp
Here I guess I need to move the default value.

Since it is the the timestamp what I need to move?
Can I move Zeroes or Spaces?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Aug 07, 2008 2:10 pm
Reply with quote

'0001-01-01-12.00.00.000001'
Back to top
View user's profile Send private message
rsm_deepak

New User


Joined: 06 Apr 2005
Posts: 30
Location: visakhapatnam

PostPosted: Thu Aug 07, 2008 2:36 pm
Reply with quote

Thanks for quick response.
But can't we give 0001-01-01-00.00.00.000000?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Aug 07, 2008 2:53 pm
Reply with quote

rsm_deepak wrote:
Thanks for quick response.
But can't we give 0001-01-01-00.00.00.000000?


yes...........
Back to top
View user's profile Send private message
Suresh Ponnusamy

Active User


Joined: 22 Feb 2008
Posts: 107
Location: New York

PostPosted: Thu Aug 07, 2008 7:19 pm
Reply with quote

Hi rsm,

I think you can give 0001-01-01-00.00.00.000000. Please check. I used this in my program.
Back to top
View user's profile Send private message
mkarthikeyan

New User


Joined: 07 Aug 2008
Posts: 34
Location: Bangalore

PostPosted: Fri Aug 08, 2008 8:31 pm
Reply with quote

Declare the timestamp column as Nullable. If the timestamp value is missing in the input then move -1 to the null indicator variable else move zero to the null indicator and input timestamp to the host variable. Insert the row into the table. the suggestion is given based that you are going to design the column & column type.

Thanks
Karthikeyan

[S/360] was the biggest, riskiest decision I ever made, and I agonized about it for weeks,but deep down I believed there was nothing IBM couldn't do.
- Tom Watson, Jr. IBM Chairman and CEO 1961-1971
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
No new posts Running a Job with the Default User ID JCL & VSAM 2
Search our Forums:

Back to Top