Catharsis has asked for the wisdom of the Perl Monks concerning the following question:

Hello

Im accessing an Oracle database to retreieve some results. The field which I am requesting is a TIME/DATE field so it should return 2006-02-19 15:26:25 but all Im getting back is the date, and an american date at that.

Is there something I can set to force it to gimme the whole thing?

Ive tried issuong this line to the DB
$oracle_dbh->do("alter session set NLS_TIMESTAMP_FORMAT = 'RRRR-MM-DD HH24:MI+:SS'");

Thanks

Replies are listed 'Best First'.
Re: Oracle DBI Timestamp
by jcc (Sexton) on Apr 20, 2006 at 15:52 UTC
    alter session set NLS_DATE_FORMAT = 'RRRR-MM-DD HH24:MI+:SS'
Re: Oracle DBI Timestamp
by dragonchild (Archbishop) on Apr 20, 2006 at 15:35 UTC
    Talk to your DBA or look at one of the FORMAT_*() functions. This is an Oracle issue (as you've identified), not a Perl issue.

    My criteria for good software:
    1. Does it work?
    2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Oracle DBI Timestamp
by TrekNoid (Pilgrim) on Apr 20, 2006 at 18:09 UTC
    If you don't really want to alter the session, you should be able to get the date format you want with the to_char function:

    select to_char(sysdate, 'RRRR-MM-DD HH24:MI:SS') from dual;
    Trek
      This works a treat, thank you very much