On Thu, Jan 03, 2002 at 01:29:51PM -0500, Ronald J Kimball wrote:
>
> Oracle uses the NLS_DATE_FORMAT parameter as the default format for dates.
> For a specific case, you can use TO_DATE, e.g.:
>
> $dbh->prepare("SELECT TO_DATE(when, 'YYYY-MM-DD HH24:MI:SS') FROM mytable");
Sorry, that should of course be TO_CHAR, not TO_DATE:
$dbh->prepare("SELECT TO_CHAR(when, 'YYYY-MM-DD HH24:MI:SS') FROM mytable");
(Realized my mistake shortly after I sent the message. Doh!)
>
> or you can change the default format for the session, e.g.:
>
> $dbh->do("ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'");
Ronald