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 date of a Column in DB2 table

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

New User


Joined: 01 Dec 2006
Posts: 29
Location: S.A

PostPosted: Mon May 07, 2007 3:42 pm    Post subject: Default date of a Column in DB2 table
Reply with quote

Hi all,

What is the default date of a Column in DB2 table . Is it 1900-01-01 ??

Thanks,
Back to top
View user's profile Send private message

mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Mon May 07, 2007 4:08 pm    Post subject: Hi
Reply with quote

Hi vab987,

What does "default date of a Column" mean?
Back to top
View user's profile Send private message
skkp2006

New User


Joined: 14 Jul 2006
Posts: 93
Location: Chennai,India

PostPosted: Mon May 07, 2007 4:37 pm    Post subject: Re: Default date of a Column in DB2 table
Reply with quote

Default date is the one which we have to specify at the time of table definition.I think if we give the date field with default it will populate "01-01-0001" otherwise it will take the current date when we insert data into the table and no value is passed to the host variables.

But i have seen that normally the default value is moved to the host variable in the program rather than while creating the table.I am also looking forward for the reason for that :-(

Regards,
Syam
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 743
Location: Germany

PostPosted: Mon May 07, 2007 6:43 pm    Post subject:
Reply with quote

Hi !

When you define a table-field which should contain a date you can specify a default.

ZZZ_ADTM DATE NOT NULL WITH DEFAULT '0001-01-01'

@skkp2006:

When you insert values into table-fields there is no automation. You have to provide the host-variable with a correct date-value for such fields. Otherwise you would get SQl-Error.

Regards, UmeySan
Back to top
View user's profile Send private message
vab987

New User


Joined: 01 Dec 2006
Posts: 29
Location: S.A

PostPosted: Wed May 09, 2007 4:14 pm    Post subject: Re: Default date of a Column in DB2 table
Reply with quote

Thanks everyone .
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 DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
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 TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm


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