Re: format date with Oracle Dynamic SQL

From: Frank van Bortel <fvanbortel_at_netscape.net>
Date: Tue, 01 Mar 2005 19:58:48 +0100
Message-ID: <d02dst$qpl$1_at_news2.zwoll1.ov.home.nl>


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 Bortel
Received on Tue Mar 01 2005 - 19:58:48 CET

Original text of this message