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 — 将 PHP 变量与查询读取的列相关联
- oci_error — 返回最后发现的错误
- oci_execute — 执行语句
- oci_fetch — 从查询中读取下一行到内部缓冲区
- 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_field_is_null — 检测当前获取的行中,字段是否为 null
- oci_field_name — 返回 statement 中的字段名
- oci_field_precision — 返回字段精度
- oci_field_scale — 返回字段范围
- oci_field_size — 返回字段大小
- oci_field_type — 返回字段的数据类型名称
- oci_field_type_raw — 返回字段的原始 Oracle 数据类型
- 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 — 返回 Oracle 数据库版本
- 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 — 设置查询预读取的行数
- oci_set_prefetch_lob — Sets the amount of data prefetched for each CLOB or BLOB.
- oci_statement_type — 返回语句的类型
- oci_unregister_taf_callback — Unregister a user-defined callback function for Oracle Database TAF
+添加备注
用户贡献的备注 2 notes
Javi Ros ¶
18 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 ¶
18 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. :-)