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 All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Sorting date into YYYYMMDD, and creat... DFSORT/ICETOOL 13
No new posts CICS UCTRAN=NO not working, need syst... CICS 3
No new posts Sort card to know that creation date ... DFSORT/ICETOOL 10
No new posts Help with SORT - I need to validate d... DFSORT/ICETOOL 11
No new posts Date format correction using dfsort DFSORT/ICETOOL 3
Search our Forums:


Back to Top