OCI ignoring NLS_DATE_FORMAT parameter
| From: | Doug McMaster | Date: | Thu, 24 Mar 2005 22:17:59 +0000 |
| Subject: | OCI ignoring NLS_DATE_FORMAT parameter | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-39034@lists.php.net to get a copy of this message | ||
Regardless of how I set the NLS_DATE_FORMAT parameter, when I do a select
statement DATE fields are returned in the Oracle default DD-MON-RR format.
I can successfully set NLS_DATE_FORMAT using either an environment variable
and restarting apache or by using ALTER SESSION SET NLS_DATE_FORMAT =
'DD-MM-RRRR HH24:MI:SS' (I would prefer to use this method).
I can verify that the NLS_DATE_FORMAT is set to my desired format both before
and after my select statement by running the query SELECT * FROM
NLS_SESSION_PARAMETERS WHERE PARAMETER='NLS_DATE_FORMAT' in my script.
This problem occurs with both PEAR DB, and with ADODB oci8 drivers. However
if I use the ADODB oracle drivers, which use the older ora functions instead
of the oci functions, ALTER SESSION works and I am able to retrieve dates in
the format I set. Unfortunately, the software I'm working on uses PEAR
DB_DataObject, and the PEAR DB Oracle driver uses the oci calls.
Version info:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
PHP 4.3.4
Apache 1.3.29
Anyone have any ideas or suggestions on why I'm seeing this problem?
Thanks,
Doug