位置: 编程技术 - 正文

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

  • 赠送给客户的库存商品怎么做账
  • 甲供材料的增值税是多少
  • 地税办理流程
  • 账面价值与计税基础之间没有差别只是计价的两种名称
  • 法人能把公司账户的钱都转走么
  • 发票税率开错了3%开成5%怎么办
  • 差旅费用什么记账凭证
  • 购入原材料开出商业承兑汇票会计分录
  • 抵扣联的抵扣期限
  • 公积金缴存基数多久调整一次
  • 收到银行转来的进账通知单,上月的销货款
  • 车间报销办公费计入什么科目
  • 余利宝怎样
  • 购买毛巾的费用是多少
  • 进项结构明细表怎么做
  • 会务费税前扣除比例
  • 预缴企业所得税分录
  • 酒店固定资产明细表范本
  • 小规模普通发票可以抵扣吗
  • 其他收益科目核算
  • 工程结算收入以前年度多结转收入怎么处理?
  • 国内企业给国外企业开发票
  • spf13-vim – Vim编辑器终极发布
  • 入库单的金额填不填价税合计
  • win11升级卡66
  • 固定资产改扩建账务处理
  • gain_trickler_3202.exe 进程查询 gain_trickler_3202进程是什么文件
  • php执行mysql语句的函数
  • 银行本票结算的特点是什么
  • 子公司使用母公司授信
  • 打开苹果safari浏览器
  • 埃托沙国家公园发展观兽旅游的优势条件
  • php类型转换的两种方法
  • 红字发票步骤
  • 企业经营状态有哪几种
  • react devtools
  • 不开票销售收入怎么做账务处理
  • 帝国cms对接小程序
  • 汽车上牌照的费用计入什么会计科目
  • 长期待摊费用属于调整账户吗
  • python sockets
  • micro start
  • 沙子产量表格
  • 床垫发票
  • sql server 2008数据库引擎等安装失败
  • 个人缴纳职业年金的比例为本人缴费工资的多少
  • 企业基建工程
  • 2020年账簿印花税减免政策
  • 员工报销材料费用会计分录
  • 建筑业营改增后税务问题
  • 年度汇算清缴交税怎么做账
  • mysql数据库子查询
  • 所有符合条件x+5的绝对值加x- 2的绝对值等于七的数x
  • sql中case when的用法
  • windows版微信能运行小程序吗
  • win1 开机启动
  • windowsserver2008r2standard激活
  • ubuntu21 安装
  • windows无法完成配置若要尝试恢复配置
  • win8计算机管理员权限
  • windows8咋关机
  • 微软windows8.1
  • win降级10.3.3
  • win10 累积更新
  • js opendialog
  • Android 开源项目集合
  • 安卓 分包解压
  • bat修改ip地址
  • vue路由router
  • js解析机制
  • java获取两个日期间的所有月份
  • nodejs使用视频教程
  • android采用什么软件架构?
  • android 笔记软件推荐
  • unity ulua
  • jquery22
  • 全国退休人员有几多人
  • 江苏省地方税务局网上办税
  • 新疆油田在哪个地方
  • 合规管理的基本要求
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设