位置: 编程技术 - 正文

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

  • 小规模免增值税是普票还是专票
  • 内部退养个人所得税政策
  • 企业所得税的会计核算
  • 分公司可以享受当地优惠吗?
  • 简易征收的老项目是指什么时候
  • 银行承兑汇票怎么取钱
  • 变更企业性质企业怎么办
  • 活动现金红包
  • 如何处理没有录音的人
  • 增值税普通发票和专用发票有什么区别
  • 渔业专业合作社简介
  • 个人去税务局开劳务费税率
  • 普通发票电子发票没有章
  • 小规模没有进项票可以开销项票吗
  • 主营业务税金及附加包括印花税吗
  • 生产型企业增值税率是多少
  • 计提个人生产经营所得个税需要贴附件吗
  • 购买国债逆回购有股东限制
  • 直接收费金融服务、提供贷款服务和金融商品转让税率
  • 本单位员工投稿怎么写
  • 股利分配政策的研究背景
  • 普票红字发票怎么写摘要
  • 多次出库的商品最后一起结账的分录怎么写?
  • 房屋出租收入是多少
  • 税金及附加包括所得税费用吗
  • 房租没有发票,怎么入费用?
  • 购入电脑一次性扣除
  • office2016安全模式
  • php公众号
  • win11电脑屏幕倒过来了怎么办
  • php options
  • php的数组函数
  • PHP:pg_consume_input()的用法_PostgreSQL函数
  • 国有土地出让收入分析报告
  • win7家庭组怎么用
  • symfony框架经验总结
  • 怎么配置tomcat服务器
  • 宝塔主机分销系统设计
  • 企业自建房出售给员工个人后还需要缴纳土地使用税么
  • 存货非正常损失的会计处理
  • 个体工商户建账办法最新
  • 小规模纳税企业销售货物或者提供应税劳务
  • 资产类账户有哪些
  • 发票报销原因
  • 小规模教育培训怎样纳税
  • 电脑买回来可以直接用吗
  • 影响企业营业利润的有哪些
  • 投资性房地产出售收入属于什么收入
  • 扣税8%
  • 利润表和资产负债表不平的原因
  • 计提增值税如何计算
  • 红冲暂估原材料如何做会计分录
  • 收款收据可以用于财务报账吗
  • 没有发票如何做会计分录
  • 已付款未认证发票怎么做账
  • 现金冲账是什么意思
  • 挂靠经营的会计处理是?
  • 集团拨款
  • 确定所开发票的项目的大类别?
  • 核定征收小规模做汇算清缴吗
  • sql server的介绍
  • mysql null+1
  • ubuntu左侧菜单不见了
  • macbook调节音量怎么没反应
  • ic_launcher.xml
  • 如何禁用u盘启动项
  • linux ntp查看
  • 批处理文件就是将若干文件集中起来
  • [置顶]JM259194
  • 动态规划之矩阵连乘
  • javascript入门经典
  • 利用职务之便谋取私利是什么罪
  • php绘制图形函数
  • jquery设置宽高
  • 使用粗盐热敷十大危害
  • windows python2和python3共存
  • javascript 基础篇2 数据类型,语句,函数
  • 发票金额模糊怎么查询
  • 农村摩托车上牌要什么证件和手续
  • 奔驰购置税多少钱
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设