位置: 编程技术 - 正文

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

  • 离职补偿的扣税比例
  • 向个人提供居住证明
  • 小规模纳税人补税怎么补
  • 关联方交易的会计处理方法
  • 产品税率下调企业是否要到税务部门备案
  • 个税专项扣除做什么用
  • 收到保险公司赔款计入什么科目
  • 企业所得税扣除凭证
  • 领用包装物会计处理
  • 法人转钱到公户是借款还是投资款
  • 工厂没给工人买保险会被处罚吗?
  • 员工借备用金怎么写摘要
  • 没有房产证应该找谁
  • 个人如何开劳务费怎么开
  • 如何网上认证发票流程
  • 工程款税款税率
  • 个税贷方余额比实际金额多
  • 建筑行业一般纳税人税率是多少
  • 开票的时候开票人是管理员
  • 去年亏损今年第一季度盈利
  • 建帐选择什么会计制度和会计准则之后能修改吗
  • 购买加油卡能否开发票
  • 出口货物退免税凭证资料应当保存几年
  • 公转私合理吗
  • mac怎么禁止开机启动
  • 服务公司收到服务费发票怎么做账
  • 农产品的增值税率
  • 财务管理终值和现值
  • 一般纳税人存货入账价值
  • php实验步骤
  • php file_exists 检查文件或目录是否存在的函数
  • 苹果官网
  • .exe是什么软件
  • 斯科默岛白玉草丛中的海鹦,威尔士彭布罗克郡 (© Ross Hoddinott/Minden Pictures)
  • 出售固定资产净收益影响营业利润吗
  • php代码提示
  • vue-router query
  • html导航栏边框
  • web前端开发html代码
  • php类和对象的关系
  • 命令行查看硬件信息
  • 原材料盘盈会计处理
  • 外经证网上查询
  • 生产企业出口退税申报流程操作
  • 货到票未到的会计分录怎么做
  • 高并发数据库解决方案
  • 正解之途
  • mysql数据库访问速度慢的解决方法
  • mysql命令行实用程序
  • 一般纳税人销售旧货
  • 应交税费属什么类科目
  • 个税专项附加继续教育如何扣除?
  • 购进固定资产的账务处理
  • 财务预付账款情况说明
  • 固定资产多少钱算固定资产
  • 招待客人会计分录
  • 房地产企业扣除项目
  • 次年发上年年终奖
  • 会计做账过程中遇到的问题
  • centos7搭建nfs详细步骤
  • 苹果7开发者模式怎么打开
  • p2p是什么文件
  • win7鼠标点了没反应
  • linux分区方案lvm
  • centos sh
  • jQuery+PHP+MySQL二级联动下拉菜单实例讲解
  • eslint-plugin
  • javascript中对象的含义
  • JQuery绑定事件的函数是
  • 安卓快速开发平台
  • 全面解析A型天秤座男
  • qpython pydroid
  • 非道路机械环保标志图片
  • 网上如何申领电瓶车牌照
  • 何艳娟出生年月
  • 什么叫银税互动
  • 增值税发票怎么购票
  • 金蝶EAS固定资产变更
  • 个人转让住宅需要缴纳什么税
  • 大排量车保险多少钱
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设