位置: 编程技术 - 正文

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

  • 营业税金及附加包括哪些
  • 增值税开票软件在哪下载
  • 什么是存货周转率?存货周转率的意义是什么
  • 出差补贴要不要发票
  • 权益工具是金融资产还是所有者权益
  • 建筑工程怎么确定施工工程进度
  • 17点是多少点
  • 长期待摊费用摊销年限规定
  • 甲公司自2018年3月1日开始自行研发一款新兴产品
  • 环保设备折旧年限和残值率
  • 广告业务增值税税率
  • 加计抵减申报表填写说明
  • 怎么确定印花税申报成功
  • 价外补贴需要交增值税吗
  • 工会经费怎样申报
  • 商业收入会计分录
  • 生物资产出售的账务处理
  • 募集资金怎么算
  • 企业生产设备产品有哪些
  • 广告费支出限额
  • 企业增值税不可以跨月交吗
  • 三证合一后章要换吗
  • 收入纳税明细怎么打印
  • 计提工资与发放工资
  • 保证金利息收入怎么开票
  • 进口增值税13可以抵扣多少
  • 上月计提费用本月怎么做账
  • 施工企业工程结算
  • 挂靠借用资质账务处理?
  • 无法ping通ip地址
  • 瑞芯微 8nm
  • PHP:mcrypt_enc_get_modes_name()的用法_Mcrypt函数
  • 赠送礼品账务处理
  • 进项税额转出可以填负数吗
  • c++~怎么用
  • cookies方法
  • 支付属于借方吗?
  • 微信小程序开发一个多少钱
  • 小规模企业要交哪些税种
  • 商贸公司对加工的影响
  • 本年利润借方红字代表什么意思
  • 帝国cms灵动标签怎么调用
  • python 多线程处理
  • 小规模首次申请发票张数
  • 新的事业单位财务规则对医院运用的变化
  • 怎么作废银联在网上银行
  • sql数据库聚集索引和非聚集索引的区别是什么?
  • 确认委托代销手续费的会计分录
  • 增值税纳税申报类型有哪些
  • 哪些增值税可以免税
  • 资本公积的账务处理例题
  • 工程在建工程转固清单
  • 研发部门的房租可以资本化
  • 收取的承包费交什么税
  • 融资租赁租金利息怎么算
  • 逾期贷款利息收入增值税和企业所得税纳税义务时间
  • 融资租赁取得的机器设备的账务处理
  • 出口海运费222011
  • 预缴所得税弥补以前年度亏损
  • 经营活动产生的现金流量净额越大越好吗
  • sql语句 时间
  • 深入理解mysql主从原理32讲
  • win10升级后c盘莫名其妙满了
  • ubuntu系统安装报错
  • linux中如何配置环境变量
  • 无线网络连接上但上不了网
  • win10系统附件游戏被删除
  • git 常用指令
  • perl keys
  • android 重启app
  • Android 使用 ASM 修改函数
  • jquery插件免费下载
  • javascript面向对象编程
  • 郑州市惠济区税务局黄国选
  • 安徽残疾人补助过年有多少钱
  • 税务局 协查函
  • 海口社保一个月多少钱
  • 西乡塘区税务局电话
  • 企业少缴社保怎么补偿
  • 招投标法实施条例是哪一年修正的
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设