I want to insert records in this table with the current date using the
curdate() function. This function returns a date and cannot be stored
directly in the field.
I already tried to find conversion functions in the DB2 documentation
but no success.
What I can do is strip out the year, month, day and construct the
numeric date but this is'nt very nice.
Does anybody know if there is a function to do this real easy?
db2 => values today_int();
1
-----------
20010917
1 record(s) selected.
Cheers
Serge
insert into tabschema.tabname (columname) values DEC(HEX(CURRENT DATE));
DEC(HEX(CURRENT DATE)) will convert current date yyyymmdd
Visit the DB2 UDB and DB2 Connect Online Support site at:
http://www.ibm.com/software/data/db2/udb/winos2unix/support
That's great, thanks.
Cheers
Serge
dec does'nt really convert hex back to numeric
so we need the counterpart from hex
HPI
Roger <roger.k...@intentia.se> wrote in message
news:bc93d2c9.01091...@posting.google.com...
It could be that the insert in fact does work.
Hex takes the internal representation of the data and could be different for
other platforms. Pretty tricky
HPI
Hans Pikkemaat <hans.pi...@nl.clientlogic.com> wrote in message
news:3ba9cf2f$0$220$4d4e...@news.nl.uu.net...
VALUES INTEGER(CURRENT DATE);
The function was added in V8.1 GA mostly for MDC.
Cheers
Serge
that was 3 (three) years ago. i've run into some old VSAM->DB2
if only it were on the 390.
(and if you've any pull at all with Google, get rid of the new
Groups page. pitiful.)
Cheers
Serge
Even I have been facing problems with postings lately. But, then you
need to understand that nobody becomes a good manager the very moment
he gets out of mom's womb..... it takes him years. so relax and give
these google guys some space to breath, after all, they spent so much
resources, time, energy to reach here.
regards,
dotyet