Home > php教程 > php手册 > 用PHP执行Oracle存储过程示例

用PHP执行Oracle存储过程示例

PHP中文网
Release: 2016-06-21 09:09:23
Original
1329 people have browsed it

用PHP执行Oracle存储过程示例  

<? 
//在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); 
?>
Copy after login


Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Latest Issues
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template