Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Default values for Timestamp

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
rsm_deepak

New User


Joined: 06 Apr 2005
Posts: 31
Location: visakhapatnam

PostPosted: Thu Aug 07, 2008 1:59 pm    Post subject: Default values for Timestamp
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    Post subject:
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: 31
Location: visakhapatnam

PostPosted: Thu Aug 07, 2008 2:36 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject: Reply to: Timestamp Question
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts Overlaying one set of charater values... Kevin Lindsley SYNCSORT 7 Sat Nov 05, 2016 3:21 am
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm
No new posts Using 'parm' to vary SORTOUT record v... Sysaron DFSORT/ICETOOL 13 Wed Sep 07, 2016 9:24 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us