位置: 编程技术 - 正文

PHP:oci_fetch_object()的用法_Oracle函数

编辑:rootadmin
oci_fetch_object

推荐整理分享PHP:oci_fetch_object()的用法_Oracle函数,希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:,内容如对您有帮助,希望把文章链接给更多的朋友!

(PHP 5, PECL OCI8 >= 1.1.0)

oci_fetch_object — Returns the next row from a query as an object

说明 object oci_fetch_object ( resource $statement )

Returns an object containing the next result-set row of a query. Each attribute of the object corresponds to a column of the row. This function is typically called in a loop until it returns FALSE, indicating no more rows exist.

要获取 OCI8扩展进行数据类型映射的细节,请参见驱动所支持的数据类型。

参数

statement

有效的 OCI8 报表标识符由 oci_parse() 创建,被 oci_execute()或 REF CURSOR statement 标识执行。

返回值

Returns an object. Each attribute of the object corresponds to a column of the row. If there are no more rows in the statement then FALSE is returned.

Any LOB columns are returned as LOB descriptors.

PHP:oci_fetch_object()的用法_Oracle函数

DATE columns are returned as strings formatted to the current date format. The default format can be changed with Oracle environment variables such as NLS_LANG or by a previously executed ALTER SESSION SET NLS_DATE_FORMAT command.

Oracle&#;s default, non-case sensitive column names will have uppercase attribute names. Case-sensitive column names will have attribute names using the exact column case. Use var_dump() on the result object to verify the appropriate case for attribute access.

Attribute values will be NULL for any NULL data fields.

范例

Example #1 oci_fetch_object() example

<?php/*Beforerunning,createthetable:CREATETABLEmytab(idNUMBER,descriptionVARCHAR2());INSERTINTOmytab(id,description)values(1,'FishandChips');COMMIT;*/$conn=oci_connect('hr','welcome','localhost/XE');if(!$conn){$e=oci_error();trigger_error(htmlentities($e['message'],ENT_QUOTES),E_USER_ERROR);}$stid=oci_parse($conn,'SELECTid,descriptionFROMmytab');oci_execute($stid);while(($row=oci_fetch_object($stid))!=false){//UseuppercaseattributenamesforeachstandardOraclecolumnecho$row->ID."<br>n";echo$row->DESCRIPTION."<br>n";}//

Example #2 oci_fetch_object() with case sensitive column names

<?php/*Beforerunning,createthetablewithacasesensitivecolumnname:CREATETABLEmytab(idNUMBER,"MyDescription"VARCHAR2());INSERTINTOmytab(id,"MyDescription")values(1,'IcedCoffee');COMMIT;*/$conn=oci_connect('hr','welcome','localhost/XE');if(!$conn){$e=oci_error();trigger_error(htmlentities($e['message'],ENT_QUOTES),E_USER_ERROR);}$stid=oci_parse($conn,'SELECTid,"MyDescription"FROMmytab');oci_execute($stid);while(($row=oci_fetch_object($stid))!=false){//UseuppercaseattributenamesforeachstandardOraclecolumnecho$row->ID."<br>n";//Usetheexactcaseforthecasesensitivecolumnnameecho$row->MyDescription."<br>n";}//

Example #3 oci_fetch_object() with LOBs

<?php/*Beforerunning,createthetable:CREATETABLEmytab(idNUMBER,descriptionCLOB);INSERTINTOmytab(id,description)values(1,'Averylongstring');COMMIT;*/$conn=oci_connect('hr','welcome','localhost/XE');if(!$conn){$e=oci_error();trigger_error(htmlentities($e['message'],ENT_QUOTES),E_USER_ERROR);}$stid=oci_parse($conn,'SELECTid,descriptionFROMmytab');oci_execute($stid);while(($row=oci_fetch_object($stid))!=false){echo$row->ID."<br>n";//ThefollowingwilloutputthefirstbytesfromDESCRIPTIONecho$row->DESCRIPTION->read()."<br>n";}//

参见

oci_fetch() - Fetches the next row into result-buffer oci_fetch_all() - 获取结果数据的所有行到一个数组 oci_fetch_assoc() - Returns the next row from a query as an associative array oci_fetch_array() - Returns the next row from a query as an associative or numeric array oci_fetch_row() - Returns the next row from a query as a numeric array

PHP:oci_fetch_row()的用法_Oracle函数 oci_fetch_row(PHP5,PECLOCI8=1.1.0)oci_fetch_rowReturnsthenextrowfromaqueryasanumericarray说明arrayoci_fetch_row(resource$statement)Returnsanumericallyindexedarraycontainingthenextresult-setrowofaque

PHP:oci_fetch_assoc()的用法_Oracle函数 oci_fetch_assoc(PHP5,PECLOCI8=1.1.0)oci_fetch_assocReturnsthenextrowfromaqueryasanassociativearray说明arrayoci_fetch_assoc(resource$statement)Returnsanassociativearraycontainingthenextresult-setrowo

PHP:oci_close()的用法_Oracle函数 oci_close(PHP5,PECLOCI8=1.1.0)oci_close关闭Oracle连接说明booloci_close(resource$connection)oci_close()将Oracle连接connection关闭。Note:自版本1.1起oci_close()正确关闭Oracle连接。

标签: PHP:oci_fetch_object()的用法_Oracle函数

本文链接地址:https://www.jiuchutong.com/biancheng/281110.html 转载请保留说明!

上一篇:PHP:oci_field_is_null()的用法_Oracle函数

下一篇:PHP:oci_fetch_row()的用法_Oracle函数

  • 个税什么会计科目
  • 不动产租赁税率9%
  • 提现的手续费怎么做账
  • 个体工商户怎样纳税
  • 二手车固定资产
  • 怎么查上个月交的社保
  • 退增值税需要多久
  • 税控发票抵税还是抵收
  • 农产品核定扣除范围
  • 车船税没有发票可以税前扣除吗
  • 销售货物的价外费用有哪些
  • 找贴现公司贴现有风险吗
  • 冲减预付账款怎么记账
  • 伤亡保险是什么意思
  • 小规模企业如何
  • 企业税收负担率一般达到多少算正常
  • 开了专票是否交文化事业建设费?
  • 一次性奖金如何交税
  • 职工个人负担的医疗保险可以在计算个人所得税前扣除
  • 合作保证金规定
  • 固定资产出售是否属于日常关联交易
  • 小规模纳税人教育费附加和地方教育费附加减免
  • 怎么分配工业企业材料费用?
  • 按简易办法征收增值税
  • 将自产产品无偿赠送税务处理
  • 其他业务成本如何核算
  • 表格怎样打印在一张a4纸上
  • 无线电路问题
  • 房地产公司的存货分析
  • 收到员工的罚款的会计科目
  • PHP:stream_context_create()的用法_Stream函数
  • 已开票未收款怎么做账
  • 年末结转利润分配账户的借方余额表示
  • Vite + Vue3 +Vant4构建项目时,按需引入使用Toast组件,引用 showToast 时出现编译报错的解决方案
  • 购货方退货并已签收
  • 合规检查中检查不了的设备
  • 快递收据能否作为发票
  • php发送短信
  • vue项目部署到服务器上,页面空白
  • 持有待售资产是流动还是非流动
  • 收到对方退回的现金
  • 企业购买机器设备没有发票怎么办
  • vue组件教程
  • php数据库网址
  • 异地预缴的附加税在申报税时会抵消掉么
  • 培训发票税点
  • python中lambda用法
  • MySQL 数据库中,用于事务授权控制的关键词是下面哪个?
  • 借款单属于外来单据吗
  • 银行手续费未开发票前计入什么科目
  • mysql数据库操作中,use是用来做什么的?
  • 汇算清缴银行手续费放哪里
  • 不抵扣进项税额转出怎么做分录处理
  • 公司交的物业费计入什么会计科目
  • 以前年度损益调整是什么意思
  • 事业单位利息收入的正确分录
  • 小企业营业外支出的内容
  • 衍生工具的作用是什么
  • 从基本存款账户划款3万元 向开户银行转帐
  • 无法确定退货率的处理
  • 开票软件服务费计入什么会计科目
  • 连接远程mq
  • window8开机
  • win7 ie
  • lsm.exe是什么程序
  • macos 安装win7
  • jQuery Mobile 和 Kendo UI 的比较
  • android内存分析显示
  • 安卓 aac
  • linux 消息队列 系统参数
  • Git && GitHub 之远程协作
  • 请问在javascript程序中
  • 你知道什么是布
  • 北京税务局发票查询
  • 四川税务局发票下载
  • 杨静儿多少岁
  • 一般纳税人企业所得税怎么征收
  • 厂房房产税2021年税率
  • 小企业会计准则会计科目表
  • 长沙买房后多久可以提取公积金
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设