位置: 编程技术 - 正文

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号文解读
  • 土地增值税四级税率表
  • 民间非营利组织有哪些
  • 购买设备对方垫付运费会计分录
  • 利润的三个计算口径
  • 房地产企业城市配套费
  • 计提工资是计提当月的还是上个月的
  • 金融企业哪些呆账损失可以在税前扣除?
  • u盘文件全都变成快捷方式怎么办
  • 鸿蒙系统获取电脑文件
  • 应收账款周转率高说明
  • 腾讯电脑管家下载
  • 电脑重装系统如何分区?
  • php常用的技术栈
  • 招投标公司需要什么条件
  • 鸿蒙系统如何设置定位
  • 托收账款属于什么会计科目
  • 超市收取进场费会计分录
  • geeklink 极联科技
  • 怀特霍尔
  • 企业未实际出资
  • 一般合同怎么写才有效
  • 企业中秋晚会主持词
  • 房开企业增值税扣除土地价款包括契税吗
  • 跨域的几种方法
  • 爱德华多·阿涅利
  • php随机抽取
  • php合并两个二维数组
  • 实例讲解YII2中多表关联的使用方法
  • 应收款项减值的核算方法
  • 差额征税收到雇主责任险进项发票能抵扣吗
  • 未发货先开票后付款是否违法
  • 周末闲暇时光是什么意思
  • 建筑企业异地预缴增值税销售额含税吗
  • 实缴的钱注销后可以拿回来吗
  • 资本公积的项目有哪些
  • python的继承用法
  • 转回存货跌价准备的会计分录
  • 银行询证函快递费计入什么科目
  • 金蝶固定资产累计折旧凭证生成
  • 经济利益的总流入
  • 筹资活动产生的现金流量净额减少说明什么
  • 稳岗补贴缴纳社保个人部分还是公司部分
  • 保险补偿多久到账
  • 积分兑换礼品需要什么
  • 取现发放劳务费怎么做账
  • 企业会计的应用指南
  • 广告制作费属于现代服务吗
  • deepin 2014系统下安装mysql数据库的方法步骤
  • 七彩虹主板 csm
  • win7系统安装完后启动不了
  • linux系统的安装与配置
  • centos6.10修改主机名
  • 优盘安装系统
  • mac怎么设置屏幕显示时间
  • xp系统自动升级win7
  • win10鼠标箭头怎么换样式
  • Win10预览版怎么变回正式版
  • 如何解除系统默认
  • win7 64位旗舰版如何实现快速删除U盘?win7快速删除U盘的设置方法
  • 手机游戏开发工具app
  • jquery input checked
  • jquery删除当前元素
  • 获取input输入值
  • jQuery prototype冲突的2种解决方法(附demo示例下载)
  • bud3d跑酷
  • flash谈广告
  • javascript的函数调用
  • 安卓手势控制app
  • 国家税务局发票查询
  • 郑州地方税务局网站官网
  • 12366纳税服务热线接收税收违法行政行为举报管理办法
  • 发票代码如何查询公司
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设