位置: 编程技术 - 正文

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

  • 销项税额的计算方法
  • 应交城建税计入哪个科目
  • 什么是库存现金的盘亏
  • 未开票收入如何填写增值税申报表
  • 基本户可以开立几个
  • 电子发票怎么开具
  • 其他债权投资是资产还是负债
  • 公司汽车的折旧费可以扺税吗
  • 一般纳税人房租费的税率是多少
  • 小企业会计准则以前年度损益调整
  • 售后服务企业返利政策
  • 农产品核定扣除范围
  • 空白增值税专用发票丢失罚款
  • 跨年收到暂估费用的发票如何处理
  • 农业企业土地租金会计分录
  • 防伪标识会有假的吗
  • 个税税费返还
  • 计提利息怎么做账
  • 详解价外费用的会计核算
  • 公司注销房产如何转给个人
  • 税务清算审计需要多久
  • 广告公司可以开维修费吗
  • 发票边上的虚线是什么
  • 待转销项税额会计分录
  • 所有的罚款都不能税前扣除吗
  • 增值税报表上填写什么
  • 小型微利企业核定征收
  • 待处理财产损益的二级科目
  • 1697510768
  • 工会经费的开支必须取得发票么
  • 固定资产资产评估
  • 在mac上安装ios应用
  • 公司和个人分别交税一部分吗
  • elementui能做什么
  • 购买股票的会计分录
  • 存货的核算方法
  • linux中断原理
  • 坏账减值准备账务处理
  • 非正常损失会计利润调整
  • PHP:imagepsencodefont()的用法_GD库图像处理函数
  • 乐观锁用法
  • 小程序从入门到精通
  • 固定资产加速折旧最新税收政策2023
  • unet模型代码matlab
  • 支付宝服务窗支付是啥
  • 汇率一般是以几位数来显示
  • 自然人税收管理系统官网
  • 公司注册登记需要提交的资料包括
  • 进项税额转出会影响当期纳税吗?
  • SQLite3中的日期时间函数使用小结
  • 其他综合收益影响所得税费用吗
  • 营改增后一般纳税人按简易办法计税的规定
  • 主营业务成本大于主营业务收入怎么办
  • 外地预缴税款如何查询
  • 企业应如何合理安排筹资期限的组合方式,优化资金结构
  • 主播工资不发应该到哪里投诉
  • 房地产营业税率是多少
  • 委托加工的应税消费品是指
  • 老板在自己的公司做事
  • 运输业户
  • 退税勾选选成抵扣勾选怎么办
  • 没有发票的费用支出怎么入账
  • 财务单独核算是什么意思
  • order by使用
  • 503 service unavailable错误说明
  • Ubuntu 14.04系统怎么安装Nvidia 私有显卡驱动?
  • win7任务栏右下角图标空白解决办法
  • 苹果mac使用
  • Linux系统配置要求
  • linux系列
  • js中script标签的作用
  • Ext中下拉列表ComboBox组件store数据格式用法介绍
  • python爬虫爬取京东某个商品
  • jquery图片轮播视频
  • unity behavior designer
  • 安卓样式大全
  • 面向对象的基础知识
  • 可以抵扣的消费税有哪些
  • 税务机关对核准类减免税的审核
  • 高新企业公布
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设