Oracle query returning values in sqlplus, but not php.
| From: | Lang Sharpe | Date: | Tue, 01 Jul 2003 02:52:05 +0000 |
| Subject: | Oracle query returning values in sqlplus, but not php. | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-28981@lists.php.net to get a copy of this message | ||
Hi all
Here is a test version of my script. It queries the data dictionary view
ALL_SOURCE. In sqlplus it returns all souce code in the database. In php it
returns no rows.
The only odd thing about it is that ALL_SOURCE.TYPE is VARCHAR2(12), and
'PACKAGE BODY' is twelve characters long. When I change 'PACKAGE BODY' to
'PACKAGE', it does return rows.
<?php
error_reporting(E_ALL);
$oradb = OCILogon('****','****','****');
$packageStmt = OCIParse($oradb,
"SELECT * FROM ALL_SOURCE WHERE TYPE = 'PACKAGE BODY'");
OCIExecute($packageStmt);
if(OCIFetchInto($packageStmt,$aLine,OCI_ASSOC)) {
echo "Cool Bananas\n";
var_dump($aLine);
} else {
echo "No Bananas\n";
}
OCILogoff($oradb);
?>
Im using PHP 4.3.2 Linked to Oracle 9.2.0.1.0 libraries connecting to oracle
9.2.0.1.0 database on another machine. Can someone confirm it is only me?
Lang