位置: 编程技术 - 正文

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函数

  • 离岸价的含义
  • 待转销项税额是几级科目
  • 装修费用应该计入什么科目
  • 应收账款贷方余额怎么调平
  • 燃气费的账务处理
  • 毛利率和主营利润率的区别
  • 施工企业材料采购
  • 退休工资缴纳个人所得税税率表
  • 营业外收入的核算内容主要有哪些
  • 金蝶标准版结转损益发生错误
  • 财政授权支付凭证后多久打款
  • 关于水利工程
  • 一般纳税人能否享受残保金优惠
  • 没有发票的房租调增金额怎算
  • 不计入工资薪金所得的有哪些补贴
  • 无法支付的其他应付款可以用现金核销吗
  • 房屋贷款基准利率表 历年查询
  • 合营企业之间为什么不构成关联方
  • 形式发票需要报关吗
  • 房屋租赁费属于什么服务
  • 企业买的商业保险退款怎么做账
  • 设备修理费
  • 管理不善造成的损失的会计分录
  • 如何结束excel
  • 主营业务成本计入成本类账户吗
  • 私营合伙企业个税怎么算
  • 广告费用计入什么会计科目
  • 清算期间会计科目
  • 高薪员工辞退补偿金
  • 分包工程的账务处理
  • 没有以前年度损益调整属于哪类科目
  • 附加税申报错误,已缴费,怎么办
  • gridviewcolumn
  • php时间戳转换成时间
  • 可予税前扣除的合理部分
  • 汇算清缴补交所得税怎么做凭证
  • 借入资金用于生产经营
  • wordpress文章主题
  • java泛型E和T
  • 慈善组织接受股票捐赠流程
  • 个人转让上市公司原始股
  • 社保应该怎么计提
  • phpcms使用教程
  • 如何解决在大学的压力英语作文
  • 生产辅料怎么分类
  • 国内旅客运输服务
  • 客户多付款不要了多这部分是哪种收入?
  • 现金折扣如何核算
  • 一般纳税人申报表电子版
  • mysql删除表中某个字段
  • 应计入应付款项的科目
  • 应收利息科目的表述
  • 进出口贸易出纳主要做什么
  • 开发票价格能否比实际金额高?
  • 防暑降温费是不是必须发
  • 还借款收据怎么写
  • 国外佣金算什么费用比较好
  • 失业保险金退回短信
  • 定金与订金不同
  • 维修服务开票
  • 发票金额小于实付金额会计分录
  • 财产清查存在的问题及原因分析
  • win10预览版绿屏重启解决
  • 怎么用winxp的系统光盘启动
  • 解决磁盘被写保护的方法
  • linux必学的100个命令
  • linux系统ftp服务
  • 在windows7中,下列叙述中错误的是
  • Win7电脑自动关机是什么原因
  • windows1021h2镜像下载
  • win7系统的桌面图标怎么调出来
  • linux里面vim
  • xcopy /s /e
  • shell函数写法
  • jquery的方法有哪些
  • unity中ngui
  • jsonp怎么使用
  • layout_gravity与gravity的区别
  • 海南省税务局网站
  • 医疗机构执业许可证办理的条件
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设