位置: 编程技术 - 正文

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

  • 报废的原材料
  • 运输公司税率和税种
  • 土地增值税计入税金及附加吗
  • 家具厂投入多少钱
  • 合同金额含税不含税
  • 金蝶固定资产累计折旧怎么改
  • 外资企业是否属于公有制经济
  • 开给个人的普票购买方怎么写
  • 工程结算扣罚款怎么开票
  • 付款给对方的会计分录
  • 金蝶专业版怎么导入备份账套
  • 租金和押金的税率
  • 出口供货企业
  • 企业购车票可以抵扣增值税吗?
  • 国税发200931号文解读
  • 印花税税目错了能申报更正吗
  • 营改增的优惠政策
  • 财务软件没有税务登记
  • 成本费用跨年度怎么计算
  • 向关联企业支付管理费用可以税前扣除吗
  • 国家征收苗木专业合作社成员土地,应该怎样出示证件
  • 股东转入实收资本
  • 视同销售的企业所得税汇缴表怎么填列?
  • 金融服务公司收取金融服务费
  • 电动汽车的出路在哪里
  • Mac怎么更改默认打开方式
  • 发票失控进项转出所得税
  • 开始菜单中的磁贴是什么
  • win10excel闪退是什么原因
  • 羊肚菌的功效和价格
  • cuda torch
  • 企业购入设备涉及的税种
  • php session_start
  • 委托银行贷款利息收入
  • 勃朗峰高度
  • php多线程与并发
  • 存货盘盈的账务处理入什么费用
  • 进项抵销项的会计分录
  • 事业单位收到的罚款收入应纳入
  • 增值税报销是什么意思
  • 差旅费报销范围包括
  • 逾期超过一年
  • 以前年度损益调整是什么意思
  • 限额领料单属于什么凭证
  • 复印件可以作为会计原始凭证吗
  • 息税前利润与盈亏平衡点
  • 高新企业如何做账
  • 进项税留底怎么处理
  • 资本化期间专门借款利息费用需将
  • 城建税教育费附加什么时候交
  • 税款返点如何做账务处理
  • 代开发票的弊端是如何体现的?
  • 收到合同预付款在账上怎么记
  • 什么情况需要预缴
  • 备品和备件的定义
  • 食堂如何做账
  • 银行日记账余额与银行对账单不符
  • 存货核算的含义
  • mysql 性能调优参数
  • 如何使用ssh
  • win7自带截图保存在哪个文件夹
  • 重装win7系统后鼠标反应慢
  • 快速释放剪贴蒙版快捷键
  • win10开机自动弹出设置界面
  • 删除同步中心图标
  • linux vmware命令行
  • cortana win10
  • linux系统的安装和常用命令
  • opengl基础知识
  • jquery通过扩展select控件实现支持enter或focus选择的方法
  • unity之血瓶金币的生成
  • android自定义样式
  • android profiler内存分析
  • 在页面中输出当前字符串的长度
  • bootstrap的表格
  • unity官方插件
  • 事务所是干什么的会计
  • 央企收入归谁
  • 土地增值税有哪些税收优惠
  • 中国民营经济十大新闻人物
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设