Re: Ora_Parse failed
| From: | Matt Hillebrand | Date: | Mon, 16 Feb 2004 23:12:50 +0000 |
| Subject: | Re: Ora_Parse failed | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-177888@lists.php.net to get a copy of this message | ||
I modified that code to make it more readable. You may be wondering why the $columns variable looks
like a string and then later like an array. Don't worry....there's no bug there. The
$query variable actually equals "select ${columns_imploded} from ${state}_spell where
${where_clauses}";
Matt
Matt Hillebrand <matt@chamerlik.com> wrote:
I have an Oracle 8 problem. Unfortunately, I can't use the OCI functions and must use the ORA
functions. The code below looks fine to me. It will return *almost* all of the rows, but then the
script just dies with no warnings or errors, even though I have called error_reporting(E_ALL). I do
get the following error message in an Apache error log:
Ora_Parse failed (ORA-00936: missing expression -- while processing OCI function OPARSE).
Here's my code:
<?
$query = "select $columns from $table where $where_clauses";
ora_parse($cursor, $query) or die("<br>ora_parse() failed: ".ora_error());
ora_exec($cursor) or die("<br>ora_exec() failed: ".ora_error());
print '<br><br><a name=results><table border=1>';
$rowcount = 0;
while(ora_fetch($cursor)) {
print '<tr>';
for($i=0; $i<sizeof($columns); $i++) {
$cell_data = ora_getcolumn($cursor, $i);
if($cell_data === false)
die("ora_getcolumn() failed: ".ora_error());
print "<td>$cell_data</td>";
}
print "</tr>\n";
}
print '</table>';
?>
Thanks for any advice.
Matt