位置: 编程技术 - 正文

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

  • 政府征用土地补偿标准2021年
  • ddp进口清关怎么交税
  • 企业的免税收入用于支出所形成的费用
  • 一般纳税人缴纳税款
  • 固定资产累计折旧会计科目
  • 佣金开什么发票内容
  • 员工报销没有发票怎么入账
  • 组织机构代码是营业执照哪几位数字
  • 其他收入月末需要结账吗
  • 减免税费期末如何结转
  • 超过诉讼时效的答辩状怎么写
  • 电子普通发票入账规则
  • 员工报销体检费,发票抬头开个人还是公司
  • 印花税销售分录
  • 营改增之后还有营业税金及附加吗
  • 借款利息开什么票
  • 个人之间的房屋抵押需要去房管局做登记吗
  • 增值税发票时效性
  • 办公低值易耗品的账务处理
  • 企业发给员工的福利要交税吗
  • 城市维护建设税的计税依据是什么
  • 合并报表中营业利润不等于
  • 事业单位固定资产盘盈账务处理
  • 跨年度的暂估入库账务处理
  • 城镇土地使用税征收标准及计算方法
  • 以前年度多计提了税金怎么办
  • 如何以快捷方式打印文件
  • linux怎么开启远程
  • 收到办公室桶装水开的普票怎样入账?
  • 代理进口货物账务怎么处理
  • win8.1怎么用
  • 为什么win+d
  • 清理系统所有垃圾
  • 房地产项目公司是什么意思
  • 金融资产的要素有哪些?
  • php ftp函数
  • thinkphp设置伪静态
  • 国产版忠犬八公观后感
  • 将资本公积转为实收资本什么变了
  • 用php制作日历2020日历表
  • 供电企业接收用户资产
  • 所得税费用为什么不计入营业利润
  • 顺风车没有发票可以税前扣除吗
  • 现金劳务收入会计分录
  • phpcms怎么样
  • 无形资产减值准备可以转回吗
  • 年会服装费属于什么费用
  • 填写企业所得税年度纳税申报表都需要哪些数据
  • 无形资产的税收优惠政策
  • 个体工商户开普票需要进项票吗
  • 个人餐饮费发票
  • 一般纳税人条件要求2020
  • 分销佣金税务账务怎么做
  • 小企业如何进行内部创新
  • 辅助生产车间的制造费用不通过制造费用核算
  • 理财利息计入什么科目
  • 会计核算健全的单位 可以选择小规模纳税的有
  • 建筑公司没有资质可以注册建造师吗
  • 短期投资怎么记账
  • windows server 2008 r2离线激活
  • window系统怎么用
  • 怎么u盘装系统win10
  • linux用户管理包括哪几个文件
  • xp的命令提示符在哪
  • pull current
  • hyper安装win7
  • linux怎么配置raid
  • qt5.15教程
  • express sendfile
  • dos命令批量处理文件
  • dos命令中删除文件命令有哪些
  • python裁剪不规则区域
  • js的自定义属性
  • jquery Deferred 快速解决异步回调的问题
  • javascript中checkbox使用方法实例演示
  • android完整开源项目
  • Python中的def
  • 普票怎么入账标识
  • 河北个体工商户年报入口
  • 社保欠缴可以放弃吗
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设