位置: 编程技术 - 正文

PHP:oci_get_implicit_resultset()的用法_Oracle函数

编辑:rootadmin
oci_get_implicit_resultset

推荐整理分享PHP:oci_get_implicit_resultset()的用法_Oracle函数,希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:,内容如对您有帮助,希望把文章链接给更多的朋友!

(PECL OCI8 >= 2.0.0)

oci_get_implicit_resultset — Returns the next child statement resource from a parent statement resource that has Oracle Database c Implicit Result Sets

说明 resource oci_get_implicit_resultset ( resource $statement )

Used to fetch consectutive sets of query results after the execution of a stored or anonymous Oracle PL/SQL block where that block returns query results with Oracle&#;s DBMS_SQL.RETURN_RESULT PL/SQL function. This allows PL/SQL blocks to easily return query results.

The child statement can be used with any of the OCI8 fetching functions: oci_fetch(), oci_fetch_all(), oci_fetch_array(), oci_fetch_object(), oci_fetch_assoc() or oci_fetch_row()

Child statements inherit their parent statement&#;s prefetch value, or it can be explicitly set with oci_set_prefetch().

参数

statement

A valid OCI8 statement identifier created by oci_parse() and executed by oci_execute(). The statement identifier may or may not be associated with a SQL statement that returns Implicit Result Sets.

返回值

Returns a statement handle for the next child statement available on statement. Returns FALSE when child statements do not exist, or all child statements have been returned by previous calls to oci_get_implicit_resultset().

范例

PHP:oci_get_implicit_resultset()的用法_Oracle函数

Example #1 Fetching Implicit Result Sets in a loop

<?php$conn=oci_connect('hr','welcome','localhost/pdborcl');if(!$conn){$e=oci_error();trigger_error(htmlentities($e['message'],ENT_QUOTES),E_USER_ERROR);}$sql='DECLAREc1SYS_REFCURSOR;BEGINOPENc1FORSELECTcity,postal_codeFROMlocationsWHEREROWNUM<4ORDERBYcity;DBMS_SQL.RETURN_RESULT(c1);OPENc1FORSELECTcountry_idFROMlocationsWHEREROWNUM<4ORDERBYcity;DBMS_SQL.RETURN_RESULT(c1);END;';$stid=oci_parse($conn,$sql);oci_execute($stid);while(($stid_c=oci_get_implicit_resultset($stid))){echo"<h2>NewImplicitResultSet:</h2>n";echo"<table>n";while(($row=oci_fetch_array($stid_c,OCI_ASSOC+OCI_RETURN_NULLS))!=false){echo"<tr>n";foreach($rowas$item){echo"<td>".($item!==null?htmlentities($item,ENT_QUOTES|ENT_SUBSTITUTE):"&nbsp;")."</td>n";}echo"</tr>n";}echo"</table>n";}//

Example #2 Getting child statement handles individually

<?php$conn=oci_connect('hr','welcome','localhost/pdborcl');if(!$conn){$e=oci_error();trigger_error(htmlentities($e['message'],ENT_QUOTES),E_USER_ERROR);}$sql='DECLAREc1SYS_REFCURSOR;BEGINOPENc1FORSELECTcity,postal_codeFROMlocationsWHEREROWNUM<4ORDERBYcity;DBMS_SQL.RETURN_RESULT(c1);OPENc1FORSELECTcountry_idFROMlocationsWHEREROWNUM<4ORDERBYcity;DBMS_SQL.RETURN_RESULT(c1);END;';$stid=oci_parse($conn,$sql);oci_execute($stid);$stid_1=oci_get_implicit_resultset($stid);$stid_2=oci_get_implicit_resultset($stid);$row=oci_fetch_array($stid_1,OCI_ASSOC+OCI_RETURN_NULLS);var_dump($row);$row=oci_fetch_array($stid_2,OCI_ASSOC+OCI_RETURN_NULLS);var_dump($row);$row=oci_fetch_array($stid_1,OCI_ASSOC+OCI_RETURN_NULLS);var_dump($row);$row=oci_fetch_array($stid_2,OCI_ASSOC+OCI_RETURN_NULLS);var_dump($row);//

Example #3 Explicitly setting the Prefetch Count

<?php$conn=oci_connect('hr','welcome','localhost/pdborcl');if(!$conn){$e=oci_error();trigger_error(htmlentities($e['message'],ENT_QUOTES),E_USER_ERROR);}$sql='DECLAREc1SYS_REFCURSOR;BEGINOPENc1FORSELECTcity,postal_codeFROMlocationsORDERBYcity;DBMS_SQL.RETURN_RESULT(c1);END;';$stid=oci_parse($conn,$sql);oci_execute($stid);$stid_c=oci_get_implicit_resultset($stid);oci_set_prefetch($stid_c,);//Settheprefetchbeforefetchingfromthechildstatementecho"<table>n";while(($row=oci_fetch_array($stid_c,OCI_ASSOC+OCI_RETURN_NULLS))!=false){echo"<tr>n";foreach($rowas$item){echo"<td>".($item!==null?htmlentities($item,ENT_QUOTES|ENT_SUBSTITUTE):"&nbsp;")."</td>n";}echo"</tr>n";}echo"</table>n";oci_free_statement($stid);oci_close($conn);?>

Example #4 Implicit Result Set example without using oci_get_implicit_resultset()

All results from all queries are returned consecutively.

<?php$conn=oci_connect('hr','welcome','localhost/pdborcl');if(!$conn){$e=oci_error();trigger_error(htmlentities($e['message'],ENT_QUOTES),E_USER_ERROR);}$sql='DECLAREc1SYS_REFCURSOR;BEGINOPENc1FORSELECTcity,postal_codeFROMlocationsWHEREROWNUM<4ORDERBYcity;DBMS_SQL.RETURN_RESULT(c1);OPENc1FORSELECTcountry_idFROMlocationsWHEREROWNUM<4ORDERBYcity;DBMS_SQL.RETURN_RESULT(c1);END;';$stid=oci_parse($conn,$sql);oci_execute($stid);//Note:oci_fetch_allandoci_fetch()cannotbeusedinthismannerecho"<table>n";while(($row=oci_fetch_array($stid,OCI_ASSOC+OCI_RETURN_NULLS))!=false){echo"<tr>n";foreach($rowas$item){echo"<td>".($item!==null?htmlentities($item,ENT_QUOTES|ENT_SUBSTITUTE):"&nbsp;")."</td>n";}echo"</tr>n";}echo"</table>n";//

注释

Note:

查询返回巨大数量的数据行时,通过增大oci8.default_prefetch值或使用 oci_set_prefetch() 可显著提高性能。

PHP:oci_free_statement()的用法_Oracle函数 oci_free_statement(PHP5,PECLOCI8=1.1.0)oci_free_statement释放关联于语句或游标的所有资源说明booloci_free_statement(resource$statement)oci_free_statement()释放关联于Oracle游标或

PHP:oci_free_descriptor()的用法_Oracle函数 oci_free_descriptor(PHP5,PECLOCI8=1.1.0)oci_free_descriptorFreesadescriptor说明booloci_free_descriptor(resource$descriptor)Freesadescriptorallocatedbyoci_new_descriptor().返回值成功时返回TRU

PHP:oci_field_type()的用法_Oracle函数 oci_field_type(PHP5,PECLOCI8=1.1.0)oci_field_type返回字段的数据类型说明mixedoci_field_type(resource$stmt,int$field)oci_field_type()返回字段的数据类型。field参数是字段的索

标签: PHP:oci_get_implicit_resultset()的用法_Oracle函数

本文链接地址:https://www.jiuchutong.com/biancheng/281099.html 转载请保留说明!

上一篇:PHP数组函数array_change_key_case()的用法 返回键名全为小写或大写的数组(php的数组函数)

下一篇:PHP:oci_free_statement()的用法_Oracle函数

  • 安徽增值税发票查询系统
  • 三大流转税包括哪些
  • 增值税即征即退怎么计算
  • 库存生产用钢材属于资产吗
  • 无形资产使用费计入什么科目
  • 营业外收入期末结转
  • 公司车辆转让需要缴纳印花税吗
  • 工程管理费如何使用
  • 售后回购融资租赁合同
  • 货物抵扣货款分录
  • 应收帐款坏帐损失摘要
  • 自营方式建造固定资产增值税
  • 全额拨款事业单位企业所得税
  • 法人代表借钱给公司可以做短期借款吗
  • 发票联丢失能用抵扣联入账吗
  • 进项税额转出是什么意思大白话
  • 增值税发票专票有效期
  • 外籍人士劳务费怎么交税
  • 增值税普通发票几个点
  • 企业的筹建期间
  • 微信收付款认证
  • 暂估运费成本的账务处理
  • 为什么有的发票没有发票章
  • 短期投资算债权吗
  • 收到的劳务费发票可以抵扣吗
  • linux强制删除文件夹
  • 什么情况下可以认定为工伤
  • 固定资产可以一次性抵扣进项税吗
  • win10 21h1激活密钥
  • win11咋截屏
  • 蜡梅的养殖方法视频
  • php中session和cookie
  • 自然保护什么意思
  • 销售货物代垫的运费会计分录
  • win11安卓子系统教程
  • 现代服务业加计抵减最新政策2022
  • 增值税普通发票和电子普通发票的区别
  • 工程质保金可以不退吗
  • 公司记账可以不开发票吗
  • 农机融资租赁公司联系方式
  • 织梦怎么添加相关
  • mysql5.7.28解压版安装教程
  • 社保年度申报错误可以调整吗
  • mysql innodb锁
  • c#连接数据库的基本步骤是什么
  • 公司减少注册资本的条件和程序
  • 管理费用的纳税调整
  • 其他应付款的辅助科目是什么
  • 公司两年未给员工申报个税违法吗
  • 印花税减免退回会计分录
  • 其他应收款款项性质如何填写
  • 计提加计抵减额的会计处理
  • 我没付款,但是显示成功?
  • mysql替换命令
  • 在Vista、Windows7下玩英雄无敌3绿色版
  • solaris的多线程实现方式
  • windows8安装程序
  • win8 preview
  • linux系统怎么安装
  • linux中软链接和硬链接的区别
  • windows10不能装windows7
  • Win10最新版下载天翼云盘
  • Tutorial2 Hello dot!
  • 爱家保障行动
  • 下面有关js中call和apply的描述,错误的是
  • bat 参数个数
  • bat中if语句的用法
  • css滚动条设置
  • node.js模块
  • unity资源库
  • jquery实现div左右移动
  • Android之BroadcastReceiver
  • jQuery插件封装时如要实现链式编程,需要
  • 如何用javascript
  • 天津2023防暑降温费标准文件
  • 土地增值税有哪些税收抵扣
  • 驻马店燃气投诉电话号码
  • 增值税专用发票电子版
  • 黑龙江国税电子税务局官网登录
  • 乡村振兴与文化遗产保护研究
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设