Oracle 8 的函數介紹_PHP教程

來源:互聯網
上載者:User
這些函數允許你存取 Oracle8 和 Oracle7 資料庫. 他使用 Oracle8 的點用介面 (OCI8). 使用這個擴充模組,你需要 Oracle8 用戶端庫檔案.
這個擴充模組比標準 Oracle 模組更流暢。他支援用於 Oracle 站位符的全域和本機 PHP 變數。有完整的 LOB, 檔案和 ROWID 支援,允許使用使用者提供的定義的變數.
在使用這個擴充之前,確認你已經正確的安裝了 oracle 使用者需要的 Oracle 環境變數, 和用於 daemon 使用者的一樣. 需要設定的變數大致為如下幾個:
ORACLE_HOME
ORACLE_SID
LD_PRELOAD
LD_LIBRARY_PATH
NLS_LANG
ORA_NLS33
在設定了你的 網頁伺服器使用者的環境變數之後,確認在你的 oracle 組裡面加入了 web伺服器使用者 (nobody, www).
例 1.
// 作者 sergo@bacup.ru
// 使用參數配置: OCI_DEFAULT 執行命令來順延強制
OCIExecute($stmt, OCI_DEFAULT);
// 得到資料:
$result = OCIResult($stmt, $n);
if (is_object ($result)) $result = $result->load();
// 進行插入或者更新操作:
$sql = "insert into table (field1, field2) values (field1 = ’value’,
field2 = empty_clob()) returning field2 into :field2";
OCIParse($conn, $sql);
$clob = OCINewDescriptor($conn, OCI_D_LOB);
OCIBindByName ($stmt, ":field2", &$clob, -1, OCI_B_CLOB);
OCIExecute($stmt, OCI_DEFAULT);
$clob->save ("some text");
?>
你可以用同樣簡單的方法儲存程式命令列.
例 2. 用於儲存進程(程式)
// 作者 webmaster@remoterealty.com
$sth = OCIParse ( $dbh, "begin sp_newaddress( :address_id, ’$firstname’,
’$lastname’, ’$company’, ’$address1’, ’$address2’, ’$city’, ’$state’,
’$postalcode’, ’$country’, :error_code );end;" );
// 這個調用用於儲存進程 sp_newaddress, 使用 :address_id 開始一個
// in/out 變數和 :error_code 用於輸出變數.
// 這樣實現捆綁:
OCIBindByName ( $sth, ":address_id", $addr_id, 10 );
OCIBindByName ( $sth, ":error_code", $errorcode, 10 );

http://www.bkjia.com/PHPjc/631045.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/631045.htmlTechArticle這些函數允許你存取 Oracle8 和 Oracle7 資料庫. 他使用 Oracle8 的點用介面 (OCI8). 使用這個擴充模組,你需要 Oracle8 用戶端庫檔案. 這個擴充模組...

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.