位置: 编程技术 - 正文

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

  • 分红给合伙企业后,被普通合伙人借走
  • 一般纳税人的申报方式
  • 增值税发票记账联和抵扣联都丢了怎么办
  • 利税总额计算公式利润表怎么计算
  • 税务师都有什么科目
  • 注销公司详细步骤
  • 其他业务收入冲应收账款
  • 深圳重工业企业有哪些
  • 企业常见的股利政策
  • 商业汇票如何申领
  • 负债必须通过转让来清偿
  • 高危职业人身意外险
  • 受托加工费的成本都有什么
  • 合伙企业的投资者李某以企业资金
  • 企业缴纳房产税的依据
  • 苗木销售免企业所得税吗
  • 营改增金融商品范围
  • 租车服务的税率
  • 小规模自开专票怎么交税
  • 酒店小规模纳税人税率
  • 法定盈余公积金转增资本不超过25%
  • 建安企业增值税税率是多少
  • 增值税完税凭证怎么做账
  • 个体工商户网上报税流程
  • 收到工程发票如何做账
  • win10桌面网络图标怎么调出来
  • 企业变更股东要交税吗
  • php干啥用
  • php大量数据处理
  • 购进商品怎么做会计分录
  • PHP:Memcached::getStats()的用法_Memcached类
  • abm文件怎么打开
  • 汇算清缴哪些表必填
  • 直接转销法账务处理
  • 企业所得税计算器在线计算
  • yii框架文档
  • pyqt5如何安装
  • opencv1.0安装
  • 代销产品的形式有哪些
  • 金蝶销售明细查不出来
  • javaweb:jquery中ajax的应用
  • 如何更改电子税务局办税人员
  • 股权转让分期付款风险
  • 哪些行业不适用税前加计扣除政策
  • 费用报销单里的类别怎么填
  • 固定资产增加
  • 公司购买汽车的会计分录
  • 咨询服务业优惠政策
  • 接受母公司捐赠现金分录
  • 股东投入的资金
  • 消防设施安装费收费标准
  • 医生规培补助
  • 长期股权投资利润调整加折旧
  • 出库单上面的单位写谁的
  • 销售收入指开票金额吗
  • 什么是稳岗补贴有多少
  • 企业列支非本单位费用
  • 每月分红会计分录
  • 固定资产折旧年限的最新规定2023
  • 在sql server中关于数据库的说法正确的是
  • CREATE FUNCTION sqlserver用户定义函数
  • MySQL中实现插入或更新操作(类似Oracle的merge语句)
  • sql server in()
  • mysql 远程连接不上
  • 怎么停止u盘自动运行
  • 怎么用ubuntu
  • 苹果系统最新版本
  • win7旗舰系统
  • apache服务器配置与使用工作笔记
  • srv32.exe - srv32进程是什么文件 有何作用
  • unix2dos命令
  • cocos2dx开发的游戏有哪些
  • nodejs发送post请求socket hand up
  • win7 python
  • jquery第十章上机
  • ADB not responding. You can wait more,or kill"abd.exe" process manually and click 'Restar
  • 一般纳税人销售收入分录
  • 车辆购置税非本人可以代缴吗
  • 劳务合同和劳务协议的区别和联系
  • 河北电子税务局社保缴费流程
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设