I am using PDO in the following code to run multiple statements in one excetute and fetchall. This works for Microsoft SQL Server but is not working for Oracle.
<?php
$conn = new PDO("odbc:oratest", "SYSTEM", "password");
$result = $conn->prepare("select * from all_objects; select * from all_users;");
$result->execute();
echo "<html><body>";
do
{
echo "<table border=\"0\">";
$row = $result->fetchAll(PDO::FETCH_ASSOC);
if($row && count($row) > 0) {
$keys = array_keys($row[0]);
echo "<tr>";
for($j = 0; $j < count($keys); $j++) {
echo "<td>" . $keys[$j] . "</td>";
}
echo "</tr>";
for($i = 0; $i < count($row); $i++) {
echo "<tr>";
for($j = 0; $j < count($keys); $j++) {
echo "<td>" . $row[$i][$keys[$j]] . "</td>";
}
echo "</tr>";
}
}
echo "</table>";
} while($result->nextRowset());
echo "</body></html>";
?>
The other code using the OCI PHP way is also not working with multiple statements:
$stid = oci_parse($conn, 'select * from all_objects; select * from all_users;');
The oci_parse just fails saying it doesnt understand the semicolon character.
Is there some way to run multiple statements in one batch simultaneously in PHP connecting to latest Oracle XE.
This question is different from the existing MySQL question as this question is about Oracle which is a different driver with different capabilities and limitations.