pdo_odbc and odbc
am 30.12.2006 05:38:25 von james tanhs------=_Part_71056_20854835.1167453505546
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hi,
I m running on :
client: XP + Apache2.2+Php5.2 ( enabled pdo, pdo_odbc, Merant)
server: oracle8i
Are there anyone having the same problem ?
Thanks.
// option 1
$db = new PDO('odbc:his', 'his', 'passwd');
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt = $db->prepare("select name from his_cust_mst where mrn = ?");
$stmt->bindValue(1, '0000003568', PDO::PARAM_STR);
try {
$stmt->execute();
while ($row = $stmt->fetch()) {
print_r($row);
}
} catch (PDOException $e) {
echo "Syntax Error: ".$e->getMessage();
}
// option 2
$Connection = odbc_connect("his","his","passwd");
$stmt = odbc_prepare($Connection, "select name from his_cust_mst where
mrn=?");
$res = odbc_execute($stmt, array('0000003568'));
if($res) $row = odbc_fetch_array($stmt);
print_r($row);
Errors:
Option1
Syntax Error: SQLSTATE[HY000]: General error: 3129 [MERANT][ODBC Oracle 8
driver][Oracle 8]ORA-03129: the next piece to be inserted is required
(SQLExecute[3129] at ext\pdo_odbc\odbc_stmt.c:133)
Option2
Warning: odbc_execute() [function.odbc-execute]: SQL error: [MERANT][ODBC
Oracle 8 driver][Oracle 8]ORA-01008: not all variables bound , SQL state
S1000 in SQLExecute in C:\Program Files\Apache Software
Foundation\Apache2.2\htdocs\hnet\testodbc.php on line 30
?>
------=_Part_71056_20854835.1167453505546--