位置: 编程技术 - 正文

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

  • 只有增值税专用发票才能抵扣进项吗
  • 视同销售计税价格如何确定?
  • 出口退税认定如何办理
  • 出口关税税率表
  • 增值税抵扣了,附加税怎么算
  • 个人收到拆迁补偿款缴税吗
  • 预期报酬率和期望报酬率一样吗
  • 转回存货跌价准备对递延所得税资产的影响
  • 生产研发设备
  • 甲公司自2018年3月1日开始自行研发一款新兴产品
  • 建筑劳务适用税率
  • 公司购买厂房需要交房产税吗
  • 应付职工薪酬的计税基础
  • 个体户没有税务登记证能注销营业执照吗
  • 印花税购销合同计税金额怎么算
  • 企业运费发票需要缴纳印花税吗附政策依据
  • 期末应交企业所得税怎么算
  • 进项税发票不认证可以吗
  • 跨地区建筑安装企业个人所得税征收方式申请表
  • 专用发票不抵扣联可以当普票用吗?
  • 固定资产清理销项税
  • 企业借款利息税前扣除怎么算
  • 吸收合并税费
  • 用于采购的借款账户
  • win 安全
  • 广告法 保险公司承保
  • 房地产开发商负责什么
  • Windows11更新后无法联网
  • php输出一维数组
  • rtfd文件
  • msg3.0.db是什么文件
  • 代开专用发票缴纳增值税需要计提吗?
  • 差额征收增值税 取得的进项可否抵扣
  • 没有独立显卡没有核显能开机吗
  • 企业的存货按照计划成本核算,期初
  • 企业所得税核定征收方法有哪两种
  • 进销存如何结转成本
  • php str函数
  • 谷歌浏览器被hao123锁定改不了
  • 报税扣款锁定怎么处理
  • 给销售人员的返点怎么做账
  • 织梦技术论坛
  • 变卖废旧物资的增值税税率
  • dedecms使用教程
  • 无形资产会产生递延所得税吗
  • 清算时存货是否要交税
  • 关联方交易的税收问题
  • 生育津贴的支付期限表述不正确的是
  • mysql主从复制实现原理
  • 商品互换概念
  • 出口没做免税申请怎么办
  • 长期待摊费用未摊销完一次性处理怎么走
  • 物流运输车类型
  • 开具其他发票收入填报异常
  • 收到了对方的作业怎么办
  • 公司加班的餐费怎么算
  • sql server 存储过程 超时
  • sql null用法
  • 电脑开机显示xp后无反应
  • Windows Server 2003下DHCP服务器的安装与简单配置图文教程
  • 在linux操作系统中,/etc/rc.d/init.d
  • solaris修改时间
  • exfat 打不开
  • schedhlp.exe - schedhlp是什么进程 作用是什么
  • win10预览体验三个选项
  • win7硬盘访问权限怎么解除
  • rhel6.5安装
  • ie11 for win8
  • win10预览版21h2
  • cocos2d-x2.2.3和android平台环境的搭建
  • chrome heat
  • android view详解
  • JavaScript indexOf方法入门实例(计算指定字符在字符串中首次出现的位置)
  • js读取文件大小
  • 辽宁省国税局网站
  • 摩托车的消费税率
  • 铅球七米
  • 税务数字证书怎么下载安装
  • 基本账号信息
  • 2021年十大慈善企业
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设