位置: 编程技术 - 正文

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

  • 收到退回的以前年度租金怎么处理
  • 新办企业申请一般纳税人的资料
  • 本月销售商品的实际成本怎么算
  • 利润表季度怎么填写
  • 企业电子发票申请不成功原因
  • 公司报销房租还能扣税吗
  • 开具红字发票的当月就要进项税额转出吗
  • 开户以后不用要钱吗
  • 用于后勤管理部的工作
  • 奖金属于应付职工薪酬
  • 个人独资企业怎么转有限公司
  • 损益表和利润表的关系
  • 资产类账户的期末余额计算公式
  • 公司用备用金去哪里投诉
  • 购货方收到代垫运费的发票怎么做会计分录?
  • 会计核算的主要依据是什么
  • 收购免税农产品的进项税可以抵扣吗
  • 交通费,通讯费均按照上级行标准领取
  • 怎么在安全模式下卸载更新
  • 增值税专用发票和普通发票的区别
  • 企业党建活动经费管理办法的规定
  • php 7z
  • macbookpro桌面整理
  • php删除用户
  • 房地产企业前期物业费
  • mac系统回到桌面快捷键
  • 出口企业免抵退不得抵扣进项
  • 前端页面默认字体
  • 融资租赁业务的特点
  • 弥补以前年度亏损后缴纳所得税
  • 一次性劳务报酬所得如何扣税
  • 确认的政府补助利得可以确认为收入吗
  • 最新版本TVBox配置地址
  • php判断文件是否存在的函数
  • python怎么做gui
  • 交所得税会计分录例题
  • 报关单在哪里打出来
  • 绿化苗木抵扣税是多少
  • php 迭代器
  • 甲供材料增值税规定
  • 工会经费怎么计算缴纳
  • 揭秘蒙娜丽莎25恐怖之处
  • sqlserver完整备份
  • 外出经营必须办理外管证吗
  • 应收账款增值税专用发票
  • 物流运输车类型
  • 建筑升降机厂家
  • 税前税后利润弥补亏损的会计分录
  • 工资薪金个人所得税怎么申报
  • 创办小企业如何起步
  • mysql中的groupby
  • mysqlsum查询慢
  • sql数据库死锁产生的原因及解决方案
  • php连接mysql数据库的几种方式及区别
  • mysql 模型
  • win8更改系统字体
  • winscope是什么意思
  • xp输入法图标不显示图片
  • searchnav.exe - searchnav是什么进程 有什么用
  • msoia.exe是什么程序
  • fnthex32.dll
  • win8怎么添加桌面
  • win10开始菜单什么样子
  • windows8各个版本区别
  • win8注销在哪里
  • cocos2dx4.0教程
  • unity4.1
  • 安卓开发框架mvvm
  • Unity3D游戏开发培训课程大纲
  • cocos2dx lua在sublime下的插件安装及查看定义
  • js表达式语法大全
  • eval()方法
  • node.js nvm
  • python程序设计的方法
  • python怎么写爬虫
  • 置顶是怎么弄的
  • 外经证的有效期是多久
  • 销售有机肥需要什么手续
  • 1国家税务总局
  • 土地出让金契税计税依据
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设