位置: 编程技术 - 正文

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

  • 成立蔬菜公司免税吗
  • 金税三期收入额是多少
  • 个人私活 要交个人所得税吗
  • 年度应纳税所得额计算公式
  • 销售二手车需要什么资质
  • 补报以前年度收入后当年所得税怎么处理
  • 小规模增值税纳税申报
  • 利润表利息费用和利息收入
  • 0税率开票如何做账
  • 出租车手撕票可以换成增值税发票吗
  • 机械费可以计入劳务单价吗
  • 增值税发票税控开票软件怎么下载
  • 月销售额不超过10万
  • 商品折扣促销方式的会计处理如何做?
  • 公司预付签证费怎么入账
  • 借用另一家公司名义
  • 土地出让金抵减销项税如何申报
  • 对方跨行转账成功后我却没收到款还能追回来吗
  • 买了两个月社保能用多少医药费
  • 电信宽带费发票专票
  • 增值税发票专票有效期
  • 不动产经营租赁属于现代服务吗
  • 什么叫增值税还是所得税
  • 自查补缴税款严重吗
  • 耗材会计分录做账怎么做
  • 计提工资当月要结转吗?
  • 公司的资产负债表包括
  • 工龄补偿款
  • linux如何用root用户登录
  • 怎么检查电脑硬件是否正常
  • 固态硬盘如何接入电脑
  • 王者荣耀中哪吒的图片
  • 电脑系统如何安装字体
  • 微信公众号 h5 保存openid
  • php api
  • 房地产企业增值税扣除土地成本
  • 预提土增税账务处理
  • 吃辣第二天长痘痘
  • php oracle 连接池
  • vuecdn方式引入
  • 音频的时域波形
  • iterator用法 移除对象
  • 资产减值损失如何确定
  • 现金流量表的填列方法
  • 工程项目过路费是指什么意思啊
  • 分公司可以分配利润吗
  • sqlserver 比较时间
  • sqlserver2008还原数据库 错误3624
  • mysql执行时间太长
  • 勾选了不抵扣还能抵扣
  • 个体工商户怎么年报
  • 投资性公司怎么做账
  • 注册资本认缴到期
  • 电影剧本稿费多少
  • 结转产品成本怎么算
  • 库存商品暂估入库是什么意思
  • 应收账款收不回来怎么处理比较好
  • 每个月计提工资没有发怎么办
  • 赠送成本的会计分录
  • 非流动资产处置利得计入什么科目
  • 计提折旧有哪些会计科目
  • sqlserver数据库测试工具
  • solaris安装教程
  • 硬盘分几个区最好
  • windows2008
  • created directory cfg怎么办
  • win7不能自动启动
  • linux系统服务器怎么进入桌面
  • window10 wifi打不开
  • 事件委托实现
  • js数组entries
  • express中间件面试题
  • python3条件语句
  • jquery给复选框赋值
  • nodejs ejs
  • unity向量的规范化
  • python中创建类对象
  • 车船税保单哪里打印
  • 黑龙江省国税局网站
  • 重庆平均缴费指数查询
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设