位置: 编程技术 - 正文

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

  • 个体户定期定额征收标准
  • 农民专业合作社章程模板
  • 企业视同销售的税法依据是什么?
  • 开农贸市场挣钱吗
  • 合伙企业需要申报个税吗
  • 期初试算平衡表不平衡怎么查
  • 本年利润每个月都转吗
  • 公司代个人收承兑汇票
  • 服务行业适用什么核算
  • 公司购买车库是什么费用
  • 机动船舶缴纳车船税吗
  • 外商投资企业土地使用税什么时候交
  • 用人单位必须要有试用期吗
  • 分摊费用怎么说合适
  • 研发部门属于哪个会计科目
  • 官司赔偿费用需要发票吗
  • 怎么开个体工商户
  • 企业汽油费会计分录
  • 抽奖获得的奖品有权转卖吗
  • 公司付电费发票怎么做账
  • 跨年的工会经费怎么做分录
  • 联营 保底
  • 地方教育附加怎么算的?
  • 社保不计提会计分录
  • 应付账款是贵公司欠还是欠贵公司
  • 我们无法创建新的分区,也找不到现有的分区 贴吧
  • 分期服务费是啥
  • 坏账准备如何做账
  • pow是什么意思中文翻译
  • 政府补助资金能否作为资本金
  • win11不能用u盘
  • services.exe
  • 借条丢了怎么办打电话给家长
  • 期间损益包括
  • proxydriod
  • php yield 异步
  • vue unknown custom element
  • 企业出售使用过的固定资产的增值税处理
  • pytorch :OSError: [WinError 1455] 页面文件太小,无法完成操作。 Error loading 【已解决】
  • php基于正则批量输出
  • js 切面
  • 一般纳税人的好处和坏处
  • 注意!PHP 7中不要做的10件事
  • 简述php操作mysql数据库的基本步骤
  • powercfg off
  • 联营企业和合营企业是什么意思
  • 挂靠方项目部账务是否并入被挂靠方公司账务?
  • 公益性怎么解释
  • 应收的货款
  • 税率开成0了怎么办
  • 增值税无票收入负数预警值
  • 受托代销商品的成本结转
  • 高铁票进项抵扣计算错了 怎么办理
  • java实现打印
  • 纳税申报怎么做
  • 抵扣税款
  • 一般纳税企业抵扣多少
  • 海关完税凭证如何取得
  • 财务分析与财务管理的共同点
  • 委托加工产品送货合同
  • 年报超时了可以补报吗
  • 专票的发票金额是价税总额吗
  • 固定资产如何管理
  • 税务会计应该设什么岗位
  • 注册表regsz是什么意思
  • Windows 2003作中转VPN服务器多路由共享上网的方法
  • win2008远程桌面闪退
  • windows7 设置
  • linux如何列出所有用户
  • 忘记mysql密码
  • win10系统edge浏览器兼容性
  • win7系统如何查找文件
  • JavaScript弹出对话框
  • unity怎么设置多个关卡
  • python发送信息到微信
  • 面向对象的三大特征
  • 进项税销项税抵扣公式
  • 福州房管局网签查询
  • oppo纳税额
  • 珠海南湾国际属于香洲哪个街道
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设