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

Default date of a Column in DB2 table


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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
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
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: 771
Location: Germany

PostPosted: Mon May 07, 2007 6:43 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Pulling a fixed number of records fro... DB2 2
No new posts How to load to DB2 with column level ... DB2 6
Search our Forums:

Back to Top