search
Homephp教程php手册Oracle 8 的函数介绍

Oracle 8 的函数介绍

Jun 13, 2016 am 10:06 AM
oracleintroduceusefunctionandaccessdatabaseof

这些函数允许你存取 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
在设置了你的 web 服务器用户的环境变量之后,确认在你的 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 );

Statement
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

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.

Undress AI Tool

Undress AI Tool

Undress images for free

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

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool