OCI8 函数
目录
- oci_bind_array_by_name — Binds a PHP array to an Oracle PL/SQL array parameter
- oci_bind_by_name — 绑定一个 PHP 变量到一个 Oracle 位置标志符
- oci_cancel — 中断游标读取数据
- oci_client_version — Returns the Oracle client library version
- oci_close — 关闭 Oracle 连接
- oci_commit — 提交未执行的事务处理
- oci_connect — 建立一个到 Oracle 服务器的连接
- oci_define_by_name — 在 SELECT 中使用 PHP 变量作为定义的步骤
- oci_error — 返回上一个错误
- oci_execute — 执行一条语句
- oci_fetch_all — 获取结果数据的所有行到一个数组
- oci_fetch_array — Returns the next row from a query as an associative or numeric array
- oci_fetch_assoc — Returns the next row from a query as an associative array
- oci_fetch_object — Returns the next row from a query as an object
- oci_fetch_row — Returns the next row from a query as a numeric array
- oci_fetch — Fetches the next row into result-buffer
- oci_field_is_null — 检查字段是否为 null
- oci_field_name — 返回字段名
- oci_field_precision — 返回字段精度
- oci_field_scale — 返回字段范围
- oci_field_size — 返回字段大小
- oci_field_type_raw — 返回字段的原始 Oracle 数据类型
- oci_field_type — 返回字段的数据类型
- oci_free_descriptor — Frees a descriptor
- oci_free_statement — 释放关联于语句或游标的所有资源
- oci_get_implicit_resultset — Returns the next child statement resource from a parent statement resource that has Oracle Database Implicit Result Sets
- oci_lob_copy — Copies large object
- oci_lob_is_equal — Compares two LOB/FILE locators for equality
- oci_new_collection — 分配新的 collection 对象
- oci_new_connect — 建定一个到 Oracle 服务器的新连接
- oci_new_cursor — 分配并返回一个新的游标(语句句柄)
- oci_new_descriptor — 初始化一个新的空 LOB 或 FILE 描述符
- oci_num_fields — 返回结果列的数目
- oci_num_rows — 返回语句执行后受影响的行数
- oci_parse — 配置 Oracle 语句预备执行
- oci_password_change — 修改 Oracle 用户的密码
- oci_pconnect — 使用一个持久连接连到 Oracle 数据库
- oci_register_taf_callback — Register a user-defined callback function for Oracle Database TAF
- oci_result — 返回所取得行中字段的值
- oci_rollback — 回滚未提交的事务
- oci_server_version — 返回服务器版本信息
- oci_set_action — Sets the action name
- oci_set_call_timeout — Sets a millisecond timeout for database calls
- oci_set_client_identifier — Sets the client identifier
- oci_set_client_info — Sets the client information
- oci_set_db_operation — Sets the database operation
- oci_set_edition — Sets the database edition
- oci_set_module_name — Sets the module name
- oci_set_prefetch_lob — Sets the amount of data prefetched for each CLOB or BLOB.
- oci_set_prefetch — 设置预提取行数
- oci_statement_type — 返回 OCI 语句的类型
- oci_unregister_taf_callback — Unregister a user-defined callback function for Oracle Database TAF
add a note
User Contributed Notes 2 notes
Javi Ros ¶
16 years ago
Here are the translate of some functions from ORA to OCI:
<?php
function Ora_Logon($usuario, $password)
{
$con = oci_connect($usuario,$password);
return $con;
}
function Ora_Open($conexion) {
$cursor[0]=$conexion;
return $cursor;
}
function Ora_Parse(&$cursor, $consulta) {
$cursor[1]=oci_parse($cursor[0],$consulta);
return $cursor;
}
function Ora_Exec(&$cursor) {
oci_execute($cursor[1]);
$cursor[2]=1;
return $cursor;
}
function Ora_Fetch(&$cursor)
{
if ($cursor[2] == 1) $cursor[2]=0;
return oci_fetch($cursor[1]);
}
function Ora_GetColumn(&$cursor, $indice)
{
if ($cursor[2] == 1) {
Ora_Fetch($cursor);
$cursor[2]=0;
}
$valor = oci_result($cursor[1],$indice+1);
return $valor;
}
function Ora_Close(&$cursor)
{
unset($cursor[1]);
}
function Ora_Logoff($conexion) {
}
?>
greatval <wow> gmail <dot> com ¶
15 years ago
For use PHPv5 functions in PHPv4 i use simple script:
<?php
$funcs=array(
'oci_connect'=>'OCILogon',
'oci_parse'=>'OCIParse',
'oci_execute'=>'OCIExecute',
'oci_fetch'=>'OCIFetch',
'oci_num_fields'=>'OCINumCols',
'oci_field_name'=>'OCIColumnName',
'oci_result'=>'OCIResult',
'oci_free_statement'=>'OCIFreeStatement',
);
// yoy can add yours pairs of funcs.
foreach ($funcs as $k=>$v)
{
if (!function_exists($k))
{
$arg_string='$p0';
for ($i=1;$i<20;$i++) {
$arg_string.=',$p'.$i;
}
eval ('function '.$k.' () {
list('.$arg_string.')=func_get_args();
return '.$v.'('.$arg_string.');
}
');
}
}
?>
simple, but it work. :-)