位置: 编程技术 - 正文

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

  • 劳务报酬申报个税流程
  • 个体工商户申报个税是按月按季度
  • 海外工作薪资比国内高多少
  • 销售是销项税还是进项税
  • 股东退股退本金及利润
  • 同一家单位发票不一样
  • 小规模建筑服务需要预缴增值税吗
  • 招待用烟的会计处理
  • 以旧换新帐务处理
  • 一般纳税人建筑公司都交什么税
  • 境内a上市公司非限售股股票转让所得怎么交个人所得税
  • 增值税专票逾期抵扣怎么操作
  • 支付稿费演出费用怎么算
  • 银行变更印鉴多久生效
  • 流动资产周转次数低说明什么
  • 评估的房产如何入账
  • 税收筹划有哪些特点?
  • 税局代开专票会计分录怎么写?
  • 房地产开发企业预收款预缴增值税
  • 华硕p8h61主板升级更换什么主板合适
  • 公司注销登记提交材料规范
  • qctray.exe - qctray进程 是什么文件 作用是什么
  • 软件开发并销售怎么做
  • 债券的到期收益率取决于
  • 科技推广和应用服务业
  • 华硕主板bios更新后开不了机
  • nod32kui.exe - nod32kui是什么进程 作用是什么
  • 苹果手机nfc录门禁卡
  • pcas service进程可以关闭么
  • 库乐队是苹果自带的嘛
  • 苹果手机系统升级后电量消耗快
  • php get post
  • 工程施工与工程结算在资产负债表里
  • 最小的的照片
  • 直线法计提折旧每年都一样吗
  • vue项目上线教程
  • 实例讲解php设计软件
  • 购买原材料月末需要结转吗
  • 长期借款和实收资本
  • php使用自定义函数编程求半径r的圆的周长和面积
  • php对数组进行排序
  • 通行费发票认证怎么操作
  • 减值准备对方科目不能是固定资产
  • 购进来的样品怎么账务处理
  • 利润表中本期金额栏各项目应根据损益类账户的什么填列
  • 社会团体收取的会费是否缴纳企业所得税
  • 买地建厂房账务处理
  • 应付利息怎么计算
  • mongodb使用场景 简书
  • 工业企业提供劳务
  • 扣缴义务人如何登录电子税务局
  • PostgreSQL管理工具phpPgAdmin入门指南
  • 实收资本冲减了工商年检怎么办呢
  • 印花税征收范围口诀
  • 阶段性减免社保费政策期限延长
  • 个人所得税不需要汇算清缴
  • 购买固定资产记账
  • 一次性伤残就业补助金怎么领取
  • 不得免征和抵扣税额抵减额分录
  • 实缴资本在公司能查到吗
  • 计税金额是什么科目
  • 在docker中使用service命令
  • mysql Community Server 5.7.19安装指南(详细)
  • sql sever使用教程
  • select * from sp_who的解决方案
  • windows需要更新吗?
  • linuxweb服务器
  • cocos creator性能
  • js domcontentloaded
  • 使用jquery实现的项目
  • nodejs命令行参数解析
  • scrapy—redis
  • node.js使用教程
  • javascriptz
  • javascript对象的常用方法
  • javascript总结
  • 山东税务局电子税务局申报
  • 合伙企业如何申报税务报表
  • 郑州市地税局局长
  • 杭州 国税
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设