Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 757
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 Compare yesterday's date to the one o... migusd SYNCSORT 4 Fri Sep 22, 2017 11:35 pm
No new posts Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm
No new posts Validate the Date girishb2 DFSORT/ICETOOL 9 Tue Sep 19, 2017 1:12 am
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us