位置: 编程技术 - 正文

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

  • 个人所得税申诉已受理多久出结果
  • 出售写字楼需要什么手续
  • 一般纳税人预缴税款几个点
  • 财税大管家客服电话
  • 业务招待费报销要求
  • 生产车间维修费是制造费用还是管理费用
  • 固定资产丢失
  • 减免的所得税额怎么入账
  • 普通发票申请表怎么填写
  • 个体户没有营业执照怎么举报
  • 开具有误拒收的增值税专用发票怎么办?
  • 业务招待费比例扣除额
  • 债权投资的账务处理步骤
  • 库存商品公司自己用怎么下账
  • 教育费附加会计分录
  • 小企业会计准则2023电子版
  • 地税保险单位编号是什么
  • 居民企业技术转让所得税优惠政策
  • 认证过的进项税怎么记账
  • 营改增之前
  • 当期损益包括哪些费用
  • 借款利息税前扣除比例
  • 小规模适用税率
  • 发工资时忘记扣个税了怎么做账
  • win11专业版打开或关闭系统图标
  • 定期存款利息收入怎么算
  • 对外贸易法律的特征包括
  • 什么是电流定律
  • 收到应缴财政款
  • PHP:pg_options()的用法_PostgreSQL函数
  • 盘盈的存货处理
  • 总包缴税
  • java 调用go
  • 代缴房产税代缴的人要负责吗
  • joomla中文手册
  • 负数发票怎么做账务处理
  • svc语法
  • 罚款支出计入什么
  • 普通纳税人怎么交税
  • 想学web前端
  • semeion手写数据集
  • msg文件怎么创建
  • 新设立的企业如何办理开业税务登记
  • 上月购进固定资产次月退货已开具红字发票如何入账
  • js中同步如何理解
  • 公司向股东借的钱怎么还
  • 劳务外包收入如何纳税
  • 预收帐款
  • 个人所得税申报数
  • 商业汇票的承兑银行必须具备下列条件
  • 去年一个月工资未计提直接计入成本,现在如何调整
  • 押金 做账
  • 住房公积金的账户状态是封存是什么意思
  • 未分配利润是负数怎么消化掉
  • 新政府会计下专业学什么
  • 哪些费用是不可抵扣的
  • 收到同业清算互联前置如何入账
  • 没有发票的费用怎么做凭证
  • 什么是建账?建账的基本程序是什么?
  • innodb 结构
  • mac设置多个桌面
  • 移动u盘的作用
  • video for windows是什么
  • xp 关机
  • 苹果电脑dock栏不见了
  • linux 应用程序
  • js中date对象
  • 持久化存储数据的方式
  • unity5.x游戏开发指南
  • opengl入门教程
  • python如何安装各种库
  • 每天一篇小练笔30字
  • jquery.validator
  • 代建工程如何缴纳增值税
  • 西安市电子税务局
  • 怎么去税务局领税盘
  • 广东省电子学校
  • 简易计税项目能即开简易税率发票又开适用税率发票吗
  • 税务注销相关文件
  • 重庆市九龙坡税务局行政服务中心电话
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设