Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

converting date to integer

Status
Not open for further replies.

vikind

MIS
Dec 11, 2003
58
US
i take SYSDATE(datetime (19)) and transform it to to_integer(to_char(sysdate)) in and integer port and send it
target table with a port UPDATE_DATE (int (4)) .. i get a value of 4 populated in the UPDATE_DATE field.. what shud be the
value of SYSDATE when converted to integer of size 4. I think it shud be "04202004" ..any ideas..is it the right value
that is getting populated.

thanks for ur help
 
You can specify the Date format in the way you need your ouput to be.
Foe eg. if you say TO_CHAR(SYSDATE,'yyyymmdd') then you will get 20040420 as output.
 
i was able to get the value 20040420 but if the integer is of size 4 then how come it accepts "20040420" which is more than the required size.

thanks..
 
int size 4 means a 4-byte integer value, which can hold a value a little over 2 billion (signed - 2^31). only character types have an actual length in the size. numeric values are the number of bytes used to hold the value.

"I think we're all Bozos on this bus!" - Firesign Theatre [jester]
 
thanks i got the point now..

appreciate ur help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top