php傳值給ORACLE預存程序,該如何處理

來源:互聯網
上載者:User
php傳值給ORACLE預存程序
本人的客戶在ORACLE伺服器上寫了一個預存程序,他告訴了我預存程序名稱(pro)、資料庫名稱、TNSNAME、訪問密碼、資料表名稱、及5個欄位名稱。

現在我要在我開發的PHP程式上遠程調用這個ORACLE預存程序,目的很簡單,就是把5個PHP變數值傳給預存程序(pro)中的5個欄位,分別是S_a 、S_b 、S_c 、S_d 、S_e

另外預存程序(pro)在接收了上面5個值之後,會返回一個結果值,欄位名為S_F

請問具體代碼要怎樣寫?

我把我所有的分都付給能解決我問題的高手!!

------解決方案--------------------
PHP code
$user = "scott";                //資料庫使用者名稱$password = "tiger";            //密碼$conn_str = "tnsname";          //串連串(cstr : Connection_STRing)$remote = true                  //是否遠端連線if ($remote) {  $conn = OCILogon($user, $password, $conn_str);}else {  $conn = OCILogon($user, $password);}$a='S_a';$b='S_b';$c='S_c';$d='S_d';$e='S_e';$sql_sp = "BEGIN PROC_TEST(:a, :b,:c,:d,:e); END;";//Parse$stmt = OCIParse($conn, $sql_sp);//執行綁定OCIBindByName($stmt, ":a", $a, 30);          OCIBindByName($stmt, ":b", $b, 30);OCIBindByName($stmt, ":c", $c, 30);OCIBindByName($stmt, ":d", $d, 30);OCIBindByName($stmt, ":e", $e, 30);OCIExecute($stmt);
代碼迷推薦解決方案:oracle預存程序,http://www.daimami.com/oracle-develop/177537.html
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.