国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Home php教程 php手冊 PHP3中使用ORACLE函數(shù)的使用說明

PHP3中使用ORACLE函數(shù)的使用說明

Jun 21, 2016 am 09:13 AM
connection int oracle string

oracle|函數(shù)

(作者:星空浪子 zhongcfido@126.com)
OCIDefineByName
讓 SELECT 指令可使用 PHP 變數(shù)。

語法: boolean OCIDefineByName(int stmt, string ColumnName, mixed &variable, int [type]);

傳回值: 布林值

函式種類: 資料庫功能




內(nèi)容說明


本函式用來定義指定的 PHP 變數(shù),使其能供 SQL 指令中的 SELECT 指令使用。在大小寫的問題上要注意一下,因?yàn)?Oracle 資料庫中的欄位名稱其實(shí)都是大寫的名字。參數(shù) stmt 是經(jīng)過 Oracle 解析 (OCIParse) 后的字串指標(biāo)。參數(shù) ColumnName 是 Oracle 資料表上的欄位名稱。參數(shù) variable 前面一定要加 & 符號(hào),表 PHP 變數(shù)位址。參數(shù) type 通常省略。值得注意的是欲使用 Oracle 8 中特有的新資料型態(tài) LOB/ROWID/BFILE 等時(shí),需要先執(zhí)行 OCINewDescriptor() 函式。執(zhí)行本函式成功則傳回 true 值。

OCIBindByName
讓動(dòng)態(tài) SQL 可使用 PHP 變數(shù)。

語法: boolean OCIBindByName(int stmt, string ph_name, mixed &variable, int length, int [type]);

傳回值: 布林值

函式種類: 資料庫功能




內(nèi)容說明


本函式用來定義指定的 PHP 變數(shù),使其能供動(dòng)態(tài)的 SQL 指令 (Oracle Placeholder) 使用。在大小寫的問題上要注意一下,因?yàn)?Oracle 資料庫中的欄位名稱其實(shí)都是大寫的名字。參數(shù) stmt 是經(jīng)過 Oracle 解析 (OCIParse) 后的字串指標(biāo)。參數(shù) ph_name 即為欲供動(dòng)態(tài) SQL 指令所使用的變數(shù)。參數(shù) variable 前面一定要加 & 符號(hào),表 PHP 變數(shù)位址。參數(shù) length 為資料的長度,若設(shè)為 -1 則使用指定的 variable 資料最大值。參數(shù) type 可省略,其值有 OCI_B_FILE (二進(jìn)位檔)、OCI_B_CFILE (文字檔)、OCI_B_CLOB (文字 LOB)、OCI_B_BLOB (位元 LOB) 及 OCI_B_ROWID (ROWID) 等數(shù)種。值得注意的是欲使用 Oracle 8 中特有的新資料型態(tài) LOB/ROWID/BFILE 等時(shí),需要先執(zhí)行 OCINewDescriptor() 函式,同時(shí)必須要將 length 參數(shù)設(shè)成 -1。執(zhí)行本函式成功則傳回 true 值。

OCILogon
開啟與 Oracle 的連結(jié)。

語法: int OCILogon(string username, string password, string [OCACLE_SID]);

傳回值: 整數(shù)

函式種類: 資料庫功能




內(nèi)容說明


本函式使 PHP 與 Oracle 建立連結(jié)。參數(shù) username 與 password 分別為連線的帳號(hào)及密碼。參數(shù) OCACLE_SID 為資料庫名稱,可省略。傳回值為連線的代碼。
OCILogOff
關(guān)閉與 Oracle 的連結(jié)。

語法: boolean OCILogOff(int connection);

傳回值: 布林值

函式種類: 資料庫功能




內(nèi)容說明


本函式使 PHP 與 Oracle 的連結(jié)結(jié)束。參數(shù) connection 為連上 Oracle 的連線代碼。傳回值 true 表示成功,false 表示發(fā)生錯(cuò)誤。
OCIExecute
執(zhí)行 Oracle 的指令區(qū)段。

語法: boolean OCIExecute(int statement, int [mode]);

傳回值: 布林值

函式種類: 資料庫功能




內(nèi)容說明


本函式用來執(zhí)行指定的 Oracle 指令區(qū)段,執(zhí)行前必須先由 OCIParse() 剖析過該區(qū)段的 SQL 語法。參數(shù) statement 為剖析過的代碼。參數(shù) mode 可省略,其內(nèi)定值為 OCI_COMMIT_ON_SUCCESS。傳回值 true 表示成功,false 表示發(fā)生錯(cuò)誤。
OCICommit
將 Oracle 的交易處理付諸實(shí)行。

語法: boolean OCICommit(int connection);

傳回值: 布林值

函式種類: 資料庫功能




內(nèi)容說明


本函式會(huì)將最近一次 commit/rollback 后的交易 (transaction) 做永久性的修改。參數(shù) connection 為連上 Oracle 的連線代碼。傳回值 true 表示成功,false 表示發(fā)生錯(cuò)誤。
OCIRollback
撤消當(dāng)前交易。

語法: boolean OCIRollback(int connection);

傳回值: 布林值

函式種類: 資料庫功能




內(nèi)容說明


本函式取消 Oracle 交易處理 (transaction) 對資料庫所做的修改。參數(shù) connection 為連上 Oracle 的連線代碼。若成功則傳回 true,反之傳回 false。
OCINumRows
取得受影響欄位的數(shù)目。

語法: int OCINumRows(int statement);

傳回值: 整數(shù)

函式種類: 資料庫功能




內(nèi)容說明


本函式傳回受 UPDATE 等指令影響的欄位 (column) 數(shù)目,若使用 SELECT 等 SQL 指令則不會(huì)有影響。參數(shù) statement 為剖析過的代碼。
OCIResult
從目前列 (row) 的資料取得一欄 (column)。

語法: string OCIResult(int statement, mixed column);

傳回值: 字串

函式種類: 資料庫功能




內(nèi)容說明


本函式傳回傳回一欄資料。參數(shù) statement 為剖析過的代碼。參數(shù) column 為欄位名。若使用新的資料形態(tài) (ROWIDs、LOBs 與 FILEs) 傳回亦均為字串。
OCIFetch
取得傳回資料的一列 (row)。

語法: int OCIFetch(int statement);

傳回值: 整數(shù)

函式種類: 資料庫功能




內(nèi)容說明


本函式用來取得一列非空的資料。參數(shù) statement 為剖析過的代碼。傳回值 true 表示成功取回一列,false 表示本列是空的或發(fā)生其它錯(cuò)誤。
OCIFetchInto
取回 Oracle 資料放入陣列。

語法: int OCIFetchInto(array &result, int [mode]);

傳回值: 整數(shù)

函式種類: 資料庫功能




內(nèi)容說明


本函式將對 Oracle 取回的資料放入陣列 result 中。傳回每列的欄位數(shù)目,若失敗則傳回 false。參數(shù) mode 可省略,內(nèi)定值為 OCI_NUM,其它還有 OCI_ASSOC、OCI_RETURN_NULLS 及 OCI_RETURN_LOBS 等。
OCIColumnIsNULL
測試傳回行是否為空的。

語法: boolean OCIColumnIsNULL(int stmt, mixed column);

傳回值: 布林值

函式種類: 資料庫功能




內(nèi)容說明


本函式用來測試傳回的行 (column) 是否為空值 (NULL)。傳回 true 表示為空值。
OCIColumnSize
取得欄位型態(tài)的大小。

語法: int OCIColumnSize(int stmt, mixed column);

傳回值: 整數(shù)

函式種類: 資料庫功能




內(nèi)容說明


本函式可以取得欄位 (column) 型態(tài) (type) 的大小。
OCINewDescriptor
初始新的 LOB/FILE 描述。

語法: string OCINewDescriptor(int connection , int [type]);

傳回值: 字串

函式種類: 資料庫功能




內(nèi)容說明


本函式用來初始化新的 LOB/FILE 描述值。
OCIParse
分析 SQL 語法。

語法: int OCIParse(int connection, string query);

傳回值: 整數(shù)

函式種類: 資料庫功能




內(nèi)容說明


本函式可用來分析 SQL 語法或是 PL/SQL 區(qū)段是否有錯(cuò)誤。參數(shù) connection 為連線代碼。參數(shù) query 為 SQL 指令字串。
?



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

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

PHP Tutorial
1502
276
How to uninstall MySQL and clean residual files How to uninstall MySQL and clean residual files Apr 29, 2025 pm 04:03 PM

To safely and thoroughly uninstall MySQL and clean all residual files, follow the following steps: 1. Stop MySQL service; 2. Uninstall MySQL packages; 3. Clean configuration files and data directories; 4. Verify that the uninstallation is thorough.

Oracle's Role in the Business World Oracle's Role in the Business World Apr 23, 2025 am 12:01 AM

Oracle is not only a database company, but also a leader in cloud computing and ERP systems. 1. Oracle provides comprehensive solutions from database to cloud services and ERP systems. 2. OracleCloud challenges AWS and Azure, providing IaaS, PaaS and SaaS services. 3. Oracle's ERP systems such as E-BusinessSuite and FusionApplications help enterprises optimize operations.

MongoDB vs. Oracle: Choosing the Right Database for Your Needs MongoDB vs. Oracle: Choosing the Right Database for Your Needs Apr 22, 2025 am 12:10 AM

MongoDB is suitable for unstructured data and high scalability requirements, while Oracle is suitable for scenarios that require strict data consistency. 1.MongoDB flexibly stores data in different structures, suitable for social media and the Internet of Things. 2. Oracle structured data model ensures data integrity and is suitable for financial transactions. 3.MongoDB scales horizontally through shards, and Oracle scales vertically through RAC. 4.MongoDB has low maintenance costs, while Oracle has high maintenance costs but is fully supported.

MySQL vs. Oracle: Licensing, Features, and Benefits MySQL vs. Oracle: Licensing, Features, and Benefits May 08, 2025 am 12:05 AM

The main difference between MySQL and Oracle is licenses, features, and advantages. 1. License: MySQL provides a GPL license for free use, and Oracle adopts a proprietary license, which is expensive. 2. Function: MySQL has simple functions and is suitable for web applications and small and medium-sized enterprises. Oracle has powerful functions and is suitable for large-scale data and complex businesses. 3. Advantages: MySQL is open source free, suitable for startups, and Oracle is reliable in performance, suitable for large enterprises.

MySQL and Oracle: Exploring Performance and Scalability MySQL and Oracle: Exploring Performance and Scalability Apr 29, 2025 am 12:12 AM

The difference between MySQL and Oracle in performance and scalability is: 1. MySQL performs better on small to medium-sized data sets, suitable for fast scaling and efficient reading and writing; 2. Oracle has more advantages in handling large data sets and complex queries, suitable for high availability and complex business logic. MySQL extends through master-slave replication and sharding technologies, while Oracle achieves high availability and scalability through RAC.

MySQL vs. Oracle: Understanding Licensing and Cost MySQL vs. Oracle: Understanding Licensing and Cost May 03, 2025 am 12:19 AM

MySQL uses GPL and commercial licenses for small and open source projects; Oracle uses commercial licenses for enterprises that require high performance. MySQL's GPL license is free, and commercial licenses require payment; Oracle license fees are calculated based on processors or users, and the cost is relatively high.

MongoDB vs. Oracle: Exploring NoSQL and Relational Approaches MongoDB vs. Oracle: Exploring NoSQL and Relational Approaches May 07, 2025 am 12:02 AM

In different application scenarios, choosing MongoDB or Oracle depends on specific needs: 1) If you need to process a large amount of unstructured data and do not have high requirements for data consistency, choose MongoDB; 2) If you need strict data consistency and complex queries, choose Oracle.

How to learn Java without taking detours. Share methods and techniques for efficiently learning Java How to learn Java without taking detours. Share methods and techniques for efficiently learning Java May 20, 2025 pm 08:24 PM

The key to learning Java without taking detours is: 1. Understand core concepts and grammar; 2. Practice more; 3. Understand memory management and garbage collection; 4. Join online communities; 5. Read other people’s code; 6. Understand common libraries and frameworks; 7. Learn to deal with common mistakes; 8. Make a learning plan and proceed step by step. These methods can help you master Java programming efficiently.

See all articles