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

how to fetch system date in db2 with syntax


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

New User


Joined: 04 Dec 2005
Posts: 45
Location: pune

PostPosted: Tue Jan 17, 2006 10:06 am
Reply with quote

can anybody tell me how to fetch system date in db2 with syntax.

thanx in advance
regards...
manjinder
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Jan 17, 2006 10:28 am
Reply with quote

Hi -

CURRENT_DATE is a DB2 special register, and is well documented (with example) in the fine manual.

O.
Back to top
View user's profile Send private message
manjinder

New User


Joined: 04 Dec 2005
Posts: 45
Location: pune

PostPosted: Tue Jan 17, 2006 10:33 am
Reply with quote

what should be there in insert query for fetching system date.
thanx in advance.
regards..
manjinder
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Jan 17, 2006 10:41 am
Reply with quote

As you can see in the fine manual, when you CREATE a table you can define the column as DATE type. If you specify "WITH DEFAULT" for that column, its default will be CURRENT DATE when you insert new row.

O.
Back to top
View user's profile Send private message
manjinder

New User


Joined: 04 Dec 2005
Posts: 45
Location: pune

PostPosted: Tue Jan 17, 2006 11:05 am
Reply with quote

thanx alott ofer it is wrking i am able to fetch system date and system timestamp.
thanx alottt for your help..
regards..
manjinder
Back to top
View user's profile Send private message
manjinder

New User


Joined: 04 Dec 2005
Posts: 45
Location: pune

PostPosted: Tue Jan 17, 2006 11:13 am
Reply with quote

please let me know the differences between alias,synonym and view
and tell me why we drop only views not synonym and alias because they dont take memory space or what?
thanx in advance.
regards...
manjinder
Back to top
View user's profile Send private message
manjinder

New User


Joined: 04 Dec 2005
Posts: 45
Location: pune

PostPosted: Tue Jan 17, 2006 11:19 am
Reply with quote

please let me know the differences between alias,synonym and view
and tell me why we drop only views not synonym and alias because they dont take memory space or what?
thanx in advance.
regards...
manjinder
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Jan 17, 2006 11:24 am
Reply with quote

Here are the definitions from the fine manual:
- Alias
- View
- Synonum

You can DROP alias, view or synonym, according to the manual.

O.
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 Sysplex System won't IPL at DR site I... All Other Mainframe Topics 2
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
Search our Forums:

Back to Top