php - 类 OCI-Lob 的对象无法转换为字符串

标签 php oracle codeigniter clob

我试图从 CodeIgniter 中的 Oracle 数据库访问 CLOB 类型字段的数据,但收到以下错误:

Message: Object of class OCI-Lob could not be converted to string

var_dump 得到如下结果后:

enter image description here

最佳答案

The Oracle “CLOB” (Character Large Object) is a data type used to store up to 4 Gigabytes of text.

To get the CLOB contents you will need to call the load() or read() methods on the returned object. The latter will require the length of data to read in bytes but has the advantage of not being limited by the script memory limit.



例子:
$result->FORUM_DESC->load();

或者
$result->FORUM_DESC->read(2000);

Source.

关于php - 类 OCI-Lob 的对象无法转换为字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53455147/

相关文章:

php - 多次提交输出

java - 在 js/php 范围内,什么是更好的选择/目标概念

PHP Codeigniter Active Records 忽略单引号

javascript - 如何允许仅选择一个动态生成的单选框?

php - 从框架到无框架

CSS 未在 Codeigniter 中加载

sql - BEGIN/END 和 EXEC 的区别

sql - 当我显示数据并仅获取 hh :mm:ss am format? 时,是否可以从 Oracle SQL DATE 隐藏 dd-mon-yyyy 组件

oracle - 在 Oracle 过程中添加条件事务行为

php - 如何对 foreach 内标题的 $item 值进行排序