位置: 编程技术 - 正文

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

  • 企业准备注销了怎么恢复
  • 外贸企业申报退税流程
  • 土地使用税是新增税吗
  • 企业所得税固定资产
  • 企业的筹建期允许有多长?
  • 已认证的专票发票在哪里
  • 转登小规模以前的留抵税额能申请退吗
  • 期初试算平衡表不平衡怎么查
  • 软件服务费280抵扣申报
  • 缴纳销项税额要交税吗
  • 职工教育经费怎么花
  • 资本公积金转增股本所获取的收益属于
  • 损益类科目计入哪个表
  • 按月付息到期还本的贷款可以提前还款吗
  • 合并报表盈余公积怎么提
  • 增值税抵扣凭证包括农产品收购发票
  • 小规模纳税人可以自己开专票吗
  • 发票的审核之真假发票的查验
  • 小规模附加税怎么计提分录
  • 企业当年发生的某些费用
  • 销售废旧物资账务处理
  • 幼儿园收的保教费是什么费
  • 季度不含税收入30万以内免增值税
  • 中途建账科目余额表怎么建
  • linux minor
  • 联想一体机如何调节屏幕亮度
  • 少收的应收款和应付账款
  • Windows 2003 SP2 简体中文版下载地址
  • 电脑启用aero
  • Window7+CentOS 6.5双系统安装图文方法
  • 国产设备投资抵免企业所得税
  • 营改增企业所得税税率
  • 其他经营收益怎么算
  • 蓝桥杯大赛2021
  • 计算机视觉基础知识
  • phpcms使用教程
  • 新注册的小公司要登记社保吗
  • 弥补以前年度亏损怎么算
  • 购买礼品的会计怎么做账
  • 企业报废原材料如何处理
  • python动态数据类型
  • 坏账准备的账务处理例题视频讲解
  • 发票第一联需要盖发票专用章吗
  • 被投资公司注销,投资收益需要交企业所得税你吗
  • mysql服务器怎么启动
  • 可供出售交易性金融资产初始计量
  • 政府工会经费计入什么科目
  • 交通运输行业属于什么性质
  • 广告赞助支出可以抵税吗
  • 单位内部食堂怎么收费
  • 残疾人就业保障金会计分录怎么做
  • 不开发票的收入如何申报纳税?
  • 企业职工福利费可用于职工的医疗卫生费用
  • 农产品成本包含所消耗的物资费用
  • 用友为什么引入不了账套
  • 免税收入计入起征点吗
  • 电子口岸登录显示证书错误
  • 库存商品成本差异怎么结转
  • 投资性房地产的范围
  • 租金收入分摊政策规定
  • win10预览版0x80072ee2
  • 装了ntfs for mac os后找不到磁盘了
  • 操作系统有哪些
  • win7系统怎么查看
  • win8手机版
  • 如何关闭office开机自启动
  • 如何下载安装windows10
  • win7 64位旗舰版系统网页字体大小如何修改变动
  • win7到欢迎界面卡半天
  • 使用netcat(瑞士军刀)进行文件传输
  • js深拷贝的三种实现方式
  • nodejs 异步io底层原理
  • 中文路径和英文路径
  • jQuery on绑定的事件
  • Node.js中的事件循环是什么
  • unity api compatibility level
  • javascript常用语句
  • 缴款单号怎么交学费
  • 讨论如何做好寺庙管理服务工作
  • 鞋类进口关税
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设