|
View previous topic :: View next topic
|
| Author |
Message |
rups
New User
Joined: 19 Jan 2006 Posts: 17 Location: bangalore
|
|
|
|
hi,
can we get current date from any db2 table.
thanks |
|
| Back to top |
|
 |
mahi
New User
.jpg)
Joined: 04 Apr 2006 Posts: 86 Location: Hyderabad
|
|
|
|
| yes we cam get it.. As per my knowledge from SYSIBM.SYSDUMMY1 we can get it.... |
|
| Back to top |
|
 |
prasadvrk
Active User
Joined: 31 May 2006 Posts: 200 Location: Netherlands
|
|
|
|
| 'SELECT CURRENT DATE FROM SYSIBM.SYSDUMMY1 INTO :WS-CURRENT-DATE ' would get you the current date into the working storage variable WS-CURRENT-DATE |
|
| Back to top |
|
 |
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
| prasadvrk wrote: |
| 'SELECT CURRENT DATE FROM SYSIBM.SYSDUMMY1 INTO :WS-CURRENT-DATE ' would get you the current date into the working storage variable WS-CURRENT-DATE |
| Code: |
EXEC SQL
SET :WS-CURRENT-DATE = CURRENT DATE
END-EXEC. |
Will also work. |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
I'm probably missing something here.
Is there some reason to interface with db2 to get a value already locally available from the system?
If you need to adjust the date, using db2 works nicly, but to just obtain the current date? Not sure i understand  |
|
| Back to top |
|
 |
vardhan0007
New User

Joined: 05 Jun 2006 Posts: 51 Location: Bangalore,India
|
|
|
|
Hi,
I want to foramt date from 'yyyy-mm-dd' to either 'mmyydd' or 'ddmmyy'
or to julian date. CAn someone assist me onthis how to format the date.
Thanks in advance
Harsha. |
|
| Back to top |
|
 |
Prajesh_v_p
Active User

Joined: 24 May 2006 Posts: 133 Location: India
|
|
|
|
Basically current date refers to special register for getting the date....and hence it does not depend on the table.. the reason why we we are using sysdummy is that, it is having only one row always..
if you do select current date from a table having N rows..it will give N records with current date..
As dick said, you can get away with a db call just for current date.. |
|
| Back to top |
|
 |
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
| vardhan0007 wrote: |
Hi,
I want to foramt date from 'yyyy-mm-dd' to either 'mmyydd' or 'ddmmyy'
or to julian date. CAn someone assist me onthis how to format the date.
Thanks in advance
Harsha. |
You ask the same question under another topic. |
|
| Back to top |
|
 |
|
|