pdo_odbc and odbc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

<?php

// 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


?>

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux