位置: 编程技术 - 正文

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

  • 注册会计师考试时间2023
  • 初中毕业可以考警察学校吗
  • 公司职工餐费用怎样入账
  • 出口退税转内销会计分录
  • 合并后少数股东权益的处理
  • 2021年成本类科目
  • 收到投资款的会计科目
  • 出纳单据交接表怎么填写
  • 简易计税和一般计税的区别
  • 有期末留抵税额增值税和附税还用计提和缴纳吗
  • 企业可以不弥补以前年度亏损吗
  • 公司内部食堂招待费账务处理
  • 代交社保费会计账务处理
  • 股权收购的好处
  • 发票专用章管理办法
  • 企业为员工购买的补充医疗保险
  • 增值税专票给客户的是第几联
  • 国税未核定税种怎么处理
  • 季报的利润表是填本期金额还是本年
  • 个税申报时个人怎么填
  • 卖护肤品赚钱吗
  • 待清算商户消费款项是什么
  • 公司决议效力确认纠纷
  • 如果工资少发怎么办
  • 公司多缴税款超过3年怎么办
  • 补提去年的所得税费用是怎么做分录?
  • 怎么检查当年的核酸结果
  • 向日葵茎上有刺吗
  • java本地缓存框架有哪些
  • 应付账款重分类含不含暂估
  • 长期待摊费用的摊销方法
  • IntersectionObserver 翻译
  • 数据挖掘期末考试大纲
  • 手把手教你安装nvidia驱动
  • thinkphp写api
  • php自动加载函数
  • 社会团体所得税汇算清缴
  • SQL SERVER 2008 64位系统无法导入ACCESS/EXCEL怎么办
  • 销售鸡蛋免税怎么交税
  • 应税销售额税率
  • 负债类账户期末余额在借方还是贷方
  • 弥补亏损的会计科目有哪些
  • 非公司人员差旅怎么报销
  • 发票融资贷款怎么做账
  • 公司破产账务处理
  • 库存现金日记账怎么填
  • 公司自己搭建的房子出租可以按投资性房地产吗
  • 淘宝卖家运费险为什么越来越贵
  • 背书转让为什么记应收票据
  • 进项票取得晚了怎么抵扣
  • 房屋装修费用的会计科目
  • sql操作方法
  • sql合并多行到一列
  • mysql5.7.22安装配置教程
  • 如何用win7
  • linux 根目录
  • xshell远程桌面
  • win10安装失败
  • linux如何用
  • cocos2dx-js
  • codeblocks视频教程
  • Android屏幕外侧滑条
  • css样式表三种方式
  • 文件上传的三个条件
  • node.js开发实战详解
  • 重装操作系统后无法开机
  • js中math.pow
  • jquery图片轮播无缝连接
  • javascript中判断数据类型的几种方法
  • python排列代码
  • javascript文本框获得焦点
  • webgl fbo
  • js颜色表
  • python消息队列感知消息被消费
  • 重庆国家税务局发票查询
  • 国税账户密码在哪里能找到
  • 消费税是含税价
  • 企业所得税汇算清缴账务处理
  • 税务师如何执业
  • 季度财务会计报告怎么写
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设