#18750 [NEW]: OCI8 failure: CHAR/VARCHAR2 datatypes in query causing errors
| From: | robert at ud dot com | Date: | Tue, 06 Aug 2002 00:41:44 +0000 |
| Subject: | #18750 [NEW]: OCI8 failure: CHAR/VARCHAR2 datatypes in query causing errors | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-16047@lists.php.net to get a copy of this message | ||
From: robert@ud.com
Operating system: RH Linux 7.2
PHP version: 4.2.1
PHP Bug Type: OCI8 related
Bug description: OCI8 failure: CHAR/VARCHAR2 datatypes in query causing errors
PHP 4.2.1 compiled using --with-oci8 against Oracle 9i (9.2) libs on RH
Linux 7.2 querying an Oracle 9i database.
Running any query that contains any Oracle CHAR or VARCHAR2 datatype
returns the following error: "Warning: OCIStmtExecute: ORA-03115:
unsupported network datatype or representation"
- Running the same queries in Oracle sqlplus client on Linux machine where
PHP was built returns all data correctly.
- Running queries that only contain numbers or dates work perfectly fine
all the way from Oracle to PHP output.
- Weirdly, casting the CHAR datatypes inside the query by wrapping them
with TO_CLOB(foo) allows PHP to display data correctly.
Are the OCI8 functions not completely compatible with the latest Oracle 9i
(9.2) release and client libs?
The PHP code I running to simply test Oracle connectivity and basic
querying:
------------------------
putenv("ORACLE_HOME=/opt/oracle/product/9.2.0");
//fails:
$strSQL = "SELECT ENAME, EMPNO FROM SCOTT.emp";
//works:
//$strSQL = "SELECT EMPNO FROM SCOTT.emp";
//works:
//$strSQL = "SELECT TO_CLOB(ENAME), EMPNO FROM SCOTT.emp";
$objDBCN = OCILogon("foo_uid","foo_pwd","foo_SID");
$objSTH = OCIParse($objDBCN, $strSQL);
OCIExecute($objSTH);
OCIFetchStatement($objSTH, $objRS);
echo "<pre>";
print_r($objRS);
echo "</pre>";
OCIFreeStatement($objSTH);
OCILogOff($objDBCN);
-------------------------
--
Edit bug report at http://bugs.php.net/?id=18750&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=18750&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=18750&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=18750&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=18750&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=18750&r=support
Expected behavior: http://bugs.php.net/fix.php?id=18750&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=18750&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=18750&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=18750&r=globals