On Mon, 27 Jan 2003, Ronald J Kimball wrote:
> On Mon, Jan 27, 2003 at 09:52:23AM -0700, Doug Hughes wrote:
> > To see what I mean try something like this:
> > $dbsrc->do("ALTER SESSION SET NLS_DATE_FORMAT='YYYY/MM/DD HH24:MI:SS'") ||
> > die $dbsrc->errstr;
> >
> > print "$_ " for $dbsrc->selectrow_array("select sysdate from dual") or die
> > "Couldn't get date $DBI->errstr";
> >
> > it still shows as 24-JAN-03 for me.
>
> It works for me. Did you try that exact code?
yes. :(
hmm
>
> BTW, earlier you said your dates were coming back as MM/DD/YYYY, but now
> you're saying the date came back as DD-Mon-YY. This is a somewhat
> confusing...
>
sorry. I shouldn't have put MM/DD/YYYY. I should have assumed that would
be taken literally. What I meant was that I was only getting month, day
and year, and that was a blithering shorthand at a very late hour. :)
Ok. I've distilled it down to this:
$ENV{'ORACLE_HOME'} = "/opt/oracle8/app/oracle/product/8.1.6/";
$ENV{'ORACLE_SID'} = "ossdb";
$ENV{NLS_DATE_FORMAT}='YYYY/MM/DD HH24:MI:SS';
my $dbsrc = DBI->connect("dbi:Oracle:$sid", $user, $pass ) or die
"nope: $!";
$dbsrc->do("ALTER SESSION SET NLS_DATE_FORMAT='YYYY/MM/DD HH24:MI:SS'") ||
die $dbsrc->errstr;
print "$_ " for $dbsrc->selectrow_array("select sysdate from dual") or die
"Couldn't get date $DBI->errstr";
result: 27-JAN-03
DBI 1.28
DBD::Oracle 1.12