位置: 编程技术 - 正文

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

  • 增值税需要年度报税吗
  • 如何注销一般纳税人账户
  • 公司账户转账给个人怎么合理避税?
  • 应交税费的借贷方向
  • 现金流量表现金流量项目明细分类
  • 补提盈余公积的分录
  • 个人与公司交的税怎么算
  • 所得税申报表里季初资产是指什么
  • 营业外支出怎么结转本年利润
  • 居间合同有效期多久
  • 黄金珠宝加工怎么样
  • 增值税附征优惠政策
  • 取消国税用什么手续
  • 股权的溢价是什么意思
  • 印花税为什么不计入资产成本
  • 关于商业健康保险产品的规范和条件
  • 债务利息税前列支什么意思
  • 资管公司如何缴纳流转税?
  • 固定资产清理税金如何处理
  • 个税三险一金指什么意思
  • 华为mate40怎么打开开发者选项
  • 新版edge浏览器文字不显示
  • 平时发票未上传怎么回事
  • windows11 怎么更新
  • 暂估入库后结转成本
  • php类型判断
  • 政策性搬迁条件
  • 购买车辆的会计分录该怎样做
  • 现金返利分录
  • 详解php匿名函数
  • 微信小程序获取位置信息的权限在哪里修改位置
  • 土地使用权的折旧年限和折旧方法
  • 国内旅客运输服务普票可以抵扣吗
  • php cache缓存
  • 真题解析买谁的
  • php session_id
  • 商业银行贷款业务按担保形式分,可分为( )
  • mysql存储引擎是什么意思
  • python中sys模块
  • 预先支付的房租
  • 企业财务报表有附注吗
  • 适用会计准则或会计制度(填写代码)
  • sql server打开方式
  • mysql日志文件在哪里
  • mac安装brew
  • 报销业务招待费是什么凭证
  • 机票改签费贵吗
  • 销售会计的岗位职责有哪些
  • 递延所得税资产和负债账务处理
  • 资质办理属于什么开票大类
  • 福利用什么表示
  • 房地产企业进项税抵扣的时间
  • 其他公司归还借款分录
  • 收据能不能入账账户
  • 无形资产自行开发
  • 进项税税额是多少
  • 销项发票怎么导出的是压缩包怎么打开
  • 企业利润分为四个方面
  • 企业有外币账户怎样做账
  • 自产产品与视同自产产品
  • 作废发票丢了罚款多少
  • 商品销售成本的计算可以采用逆算成本法,其操作方法是
  • sql server安装完 C盘空间一直减少
  • win10周年版
  • xp系统安装版如何安装
  • linux查看文件夹大小
  • 未能打开这台计算机上的组策略对象
  • win8 升级 win10
  • win10预览版21337
  • Linux系统中下载文件的wget命令操作实例
  • 批处理应用实例
  • 关于H1的位置解析
  • 安卓小项目实战软件
  • Android系统服务
  • 购物金怎么退换面额的
  • 云南国税app
  • 店面转让,房租怎么交税
  • 国家税务总局黑龙江电子税务局下载
  • 当前土地增值税优惠政策
  • 个人所得税年申报与月申报区别
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设