用PHP执行Oracle存储过程示例

发表于:2007-07-14来源:作者:点击数: 标签:
? //在 oracle 中执行存储过程示例 //供大家参考 $gConn=ocilogon(test,test); /* OCIDefineByPos example thies@digicol.de (980219) */ //discrate与nEcode是out parameter,其余均是 in parameter. //存储过程get_discrate存放于package ebiz_pg中。 $stmt


<?
//在oracle中执行存储过程示例
//供大家参考
$gConn=ocilogon("test","test");

/* OCIDefineByPos example thies@digicol.de (980219) */
//discrate与nEcode是out parameter,其余均是 in parameter.
//存储过程get_discrate存放于package ebiz_pg中。
$stmt = OCIParse($gConn,"BEGIN ebiz_pg.get_discrate(:discrate,505,402,1,56,:nEcode);END;");
OCIBindByName($stmt,":discrate",&$discrate,32);
OCIBindByName($stmt,":nEcode",&$nEcode,32);
OCIExecute($stmt);

echo($discrate);
echo("<br>");
echo($nEcode);

//echo($discrate*0.09);
OCIFreeStatement($stmt);
OCILogoff($gConn);
?>

原文转自:http://www.ltesting.net