| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.oracle -> Re: format date with Oracle Dynamic SQL
deadlocklegend_at_gmail.com wrote:
> Hi all,
>
> when i set a date field's type (12) to VARCHAR2 or STRING, I get the
> date (mm/dd/yyyy) correct, but I can never get the time which is always
> set to 00:00:00 even if i increase the buffer size? Is there anyway to
> force pro*c to format correctly without using to_char because with
> to_char i lose the ability to keep track of correct data type.
>
> Thanks
>
Dates are stored internally as numbers, and always include a time fraction.
The display (or format) mask is what makes it visible
as a date - but you must specify it.
What you experience is the default date format, try
to select to_char([your_date_column],'dd-Mon-yyyy HH24:MI:SS')
from your_table.
All date format masks are documented; search tahiti.oracle.com
-- Regards, Frank van BortelReceived on Tue Mar 01 2005 - 12:58:48 CST
![]() |
![]() |