Welcome Guest, Not a member yet? Register   Sign In
error clob (oracle) value in code igniter, how to solve it?
#1

[eluser]kreamik[/eluser]
sorry if i break any rules because i copy this from stackoverflow.com
question in stack overflow

i have data in my oracle and retrieve it from codeigniter

my data for detail is : remark1,null, remark2

my query:
Code:
$this->db->select('detail');
$r = $this->db->get($tableName);
$result = $r->result();

data model :
Code:
function get_ora_blob_value($value)
{
     $size = $value->size();
     $result = $value->read($size);
            return ($result)?$result:NULL;
}

print_r($result) :
Code:
Array
    (
        [0] => stdClass Object
            (
                [DETAIL] => OCI-Lob Object
                    (
                        [descriptor] => Resource id #80
                    )
            )
    
        [1] => stdClass Object
            (
                [DETAIL] =>
            )
    
        [2] => stdClass Object
            (
                [DETAIL] => OCI-Lob Object
                    (
                        [descriptor] => Resource id #80
                    )
            )
    )

retrieving data:
Code:
echo $this->data->get_ora_blob_value($result[0][DETAIL]); // should be 'remark1'
    echo "<br />";
    echo $this->data->get_ora_blob_value($result[1][DETAIL]); // should be null
    echo "<br />";
    echo $this->data->get_ora_blob_value($result[2][DETAIL]); // should be 'remark2'

printed :
Code:
remark2
    (empty)
    (empty)

why first data has value of third data? and third data become empty?




Theme © iAndrew 2016 - Forum software by © MyBB