位置: 编程技术 - 正文

PHP:oci_set_prefetch()的用法_Oracle函数

编辑:rootadmin
oci_set_prefetch

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

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

(PHP 5, PECL OCI8 >= 1.1.0)

oci_set_prefetch — 设置预提取行数

说明 bool oci_set_prefetch ( resource $statement [, int $rows ] )

在成功调用 oci_execute() 之后设定预提取的行数。rows 的默认值为 1。

Note:

在 PHP 5.0.0 之前的版本必须使用 ocisetprefetch() 替代本函数。该函数名仍然可用,为向下兼容作为 oci_set_prefetch() 的别名。不过其已被废弃,不推荐使用。

成功时返回 TRUE, 或者在失败时返回 FALSE。

参见 oci8_.default_prefetch INI 选项。

参数

statement

有效的 OCI8 报表标识符由 oci_parse() 创建,被 oci_execute()或 REF CURSOR statement 标识执行。

rows

The number of rows to be prefetched, >= 0

返回值 PHP:oci_set_prefetch()的用法_Oracle函数

成功时返回 TRUE, 或者在失败时返回 FALSE。

更新日志

版本 说明 PHP 5.3.2 (PECL OCI8 1.4) Before this release, rows must be >= 1. PHP 5.3 (PECL OCI8 1.3.4) Before this release, prefetching was limited to the lesser of rows rows and * rows bytes. The byte size restriction has now been removed.

范例

Example #1 Changing the default prefetch value for a query

<?php$conn=oci_connect('hr','welcome','localhost/XE');$stid=oci_parse($conn,'SELECT*FROMmyverybigtable');oci_set_prefetch($stid,);//Setbeforecallingoci_execute()oci_execute($stid);echo"<tableborder='1'>n";while($row=oci_fetch_array($stid,OCI_ASSOC+OCI_RETURN_NULLS)){echo"<tr>n";foreach($rowas$item){echo"<td>".($item!==null?htmlentities($item,ENT_QUOTES):"&nbsp;")."</td>n";}echo"</tr>n";}echo"</table>n";oci_free_statement($stid);oci_close($conn);?>

Example #2 Changing the default prefetch for a REF CURSOR fetch

<?php/*CreatethePL/SQLstoredprocedureas:CREATEORREPLACEPROCEDUREmyproc(p1OUTSYS_REFCURSOR)ASBEGINOPENp1FORSELECT*FROMall_objectsWHEREROWNUM<;END;*/$conn=oci_connect('hr','welcome','localhost/XE');$stid=oci_parse($conn,'BEGINmyproc(:rc);END;');$refcur=oci_new_cursor($conn);oci_bind_by_name($stid,':rc',$refcur,-1,OCI_B_CURSOR);oci_execute($stid);//Changetheprefetchbeforeexecutingthecursor.//REFCURSORprefetchingworkswhenPHPislinkedwithOraclegR2Clientlibrariesoci_set_prefetch($refcur,);oci_execute($refcur);echo"<tableborder='1'>n";while($row=oci_fetch_array($refcur,OCI_ASSOC+OCI_RETURN_NULLS)){echo"<tr>n";foreach($rowas$item){echo"<td>".($item!==null?htmlentities($item,ENT_QUOTES):"&nbsp;")."</td>n";}echo"</tr>n";}echo"</table>n";oci_free_statement($refcur);oci_free_statement($stid);oci_close($conn);?>

If PHP OCI8 fetches from a REF CURSOR and then passes the REF CURSOR back to a second PL/SQL procedure for further processing, then set the REF CURSOR prefetch count to 0 to avoid rows being "lost" from the result set. The prefetch value is the number of extra rows fetched in each OCI8 internal request to the database, so setting it to 0 means only fetch one row at a time.

Example #3 Setting the prefetch value when passing a REF CURSOR back to Oracle

<?php$conn=oci_connect('hr','welcome','localhost/orcl');//gettheREFCURSOR$stid=oci_parse($conn,'BEGINmyproc(:rc_out);END;');$refcur=oci_new_cursor($conn);oci_bind_by_name($stid,':rc_out',$refcur,-1,OCI_B_CURSOR);oci_execute($stid);//Displaytworows,butdon'tprefetchanyextrarowsotherwise//thoseextrarowswouldnotbepassedbacktomyproc_use_rc().//Aprefetchvalueof0isallowedinPHP5.3.2andPECLOCI.4oci_set_prefetch($refcur,0);oci_execute($refcur);$row=oci_fetch_array($refcur);var_dump($row);$row=oci_fetch_array($refcur);var_dump($row);//passtheREFCURSORtomyproc_use_rc()todomoredataprocessing//withtheresultset$stid=oci_parse($conn,'beginmyproc_use_rc(:rc_in);end;');oci_bind_by_name($stid,':rc_in',$refcur,-1,OCI_B_CURSOR);oci_execute($stid);?>

注释

Note:

In PHP versions before 5.0.0 use ocisetprefetch() instead. 在当前版本中,旧的函数名还可以被使用,但已经被废弃并不建议使用。

参见

oci8.default_prefetch ini option

PHP:oci_set_client_identifier()的用法_Oracle函数 oci_set_client_identifier(PHP5.3.2,PECLOCI8=1.4.0)oci_set_client_identifierSetstheclientidentifier说明booloci_set_client_identifier(resource$connection,string$client_identifier)Setstheclientidentifi

PHP:oci_set_edition()的用法_Oracle函数 oci_set_edition(PHP5.3.2,PECLOCI8=1.4.0)oci_set_editionSetsthedatabaseedition说明booloci_set_edition(string$edition)Setsthedatabaseeditionofobjectstobeusedbyasubsequentconnections.OracleEditionsallo

PHP:oci_set_client_info()的用法_Oracle函数 oci_set_client_info(PHP5.3.2,PECLOCI8=1.4.0)oci_set_client_infoSetstheclientinformation说明booloci_set_client_info(resource$connection,string$client_info)SetstheclientinformationforOracletracing.The

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

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

上一篇:PHP:oci_set_module_name()的用法_Oracle函数

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

  • 消费型增值税的特点的是( )
  • 什么叫做增值税进项税额
  • 增值税普通发票需要交税吗
  • 坏账损失核算的两种方法
  • 检查记账凭证的主要方法有哪些?
  • 建筑公司跨区域迁入
  • 预付账款和应付账款的区别
  • 劳务属于什么工种
  • 上季度所得税申报怎么填
  • 审计库存现金盘点方法
  • 第三方协议补贴
  • 养老金余额退休能取吗
  • 购进原材料没有发票怎么做分录
  • 违反劳动合同的责任
  • 餐饮企业收到现金抵用券会计分录
  • 有了营业执照就可以买社保了吗
  • 北京增值税纳税申报表在哪里打印
  • 工商年检社保缴费基数按什么标准填
  • 1697509310
  • 今年交去年的工会经费账务处理?
  • 股权筹资的概念
  • 2021年windows最新版本
  • 苹果手机id被锁定什么意思
  • 单位垫付资金如何做账
  • 未开发的土地被司法查封,自然资源局可以收回吗
  • 上月多计提的所得税怎么做分录
  • 低值易耗品的管理和流程ppt
  • macOS Big Sur 11.4 Beta 1(版本号20F5046g)正式发布
  • 委托代销视同买断会计分录怎么写?
  • 增值税纳税筹划案例最新
  • 北极熊睡觉图片卡通
  • laravel app接口
  • 2021mathorcupc题答案
  • ai当前的发展
  • php入门基础教程
  • 发票验证校验码为什么只能填6位
  • 保教费属于什么收入
  • day10-Tomcat02
  • 保险公司工伤怎么赔付
  • 贴现法付息的实际利息
  • sql server数据库设置定时任务
  • 分公司注销怎么起诉公司
  • 双分录怎么做记账凭证
  • 发放工资凭证后多久到账
  • 应付账款清账账务处理
  • 贴现利息的计算公式为
  • 如何计算政府补贴应摊销
  • 辅助生产费用如何判断受益多少事指什么
  • 一般纳税人取得普票怎么做账
  • 暂估出库需要确认收入吗
  • 购买税盘全额抵扣会计分录
  • 现金日记账和银行存款日记账必须逐日结出余额
  • 银行对账单怎么打印
  • mysql中json格式是多少长度
  • mysql压缩包安装教程8.0.20
  • solaris 安装
  • git不小心改了master
  • freebsd ip配置
  • centos etc
  • os x 10.11 el capitan系统安装图文教程
  • win8补丁官网
  • mousemenu是什么文件夹
  • win7系统怎么设置浏览器主页
  • node.js批量添加数据
  • 疯狂Android讲义(kotlin版)
  • 网页shell命令
  • nodejs image
  • ie6-ie10的浏览器
  • javascript闭包详解
  • php实现登录功能
  • install ubuntu kylin
  • android自定义view的三大流程
  • 电子发票密码在哪里看
  • 高速公路发票在哪里开
  • 贵州电子税务局怎么登录
  • 增值税进项发票如何做账
  • 税控盘离线开票时间超限是怎么回事
  • 江苏税务局电子
  • 地税局与税务局的区别
  • 计提缴纳城建税分录
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设