ID: 46728 Comment by: crescentfreshpot at yahoo dot com Reported By: berlioz at nicematin dot fr Status: Open Bug Type: PDO related Operating System: Linux (All ?) PHP Version: 5.2.6 New Comment:
Sorry, I meant: It seems there is no way to get oci_fetch_all (and presumably PDO_OCI since it uses the same oci.c api) return lob data as separate, individual streams. Previous Comments: ------------------------------------------------------------------------ [2009-02-22 04:48:09] crescentfreshpot at yahoo dot com Seems similar to bug #37706 I reported in the oci8 module a while back. All my fetched rows would all point to the same (last fetched) lob descriptor. It seems there is no way to stop oci_fetch_all (and presumably PDO_OCI since it uses the same oci.c api) from automatically fetching lob data and return them as separate, individual streams. ------------------------------------------------------------------------ [2008-12-02 08:56:07] berlioz at nicematin dot fr Description: ------------ in PDO_OCI when you retrieve records from a table with a CLOB field using fetchAll(), fetchAll() returns different resource ids but they all contain the same datas from the last record of the set. Other fields are ok. if you loop with fetch it works fine. Reproduce code: --------------- $conn = new PDO("oci:dbname=".$tns,$db_username,$db_password); $stmt=$conn->query('select * from my_table_with_clob'); $records=$stmt->fetchAll(PDO::FETCH_ASSOC); print_r($records); foreach($records as $record) { echo "my_clob=".stream_get_contents($record['MY_CLOB'])."\n"; } Expected result: ---------------- my_clob=Data from record 0 my_clob=Data from record 1 my_clob=Data from record 2 my_clob=Data from record 3 my_clob=Data from record 4 Actual result: -------------- my_clob=Data from record 4 my_clob=Data from record 4 my_clob=Data from record 4 my_clob=Data from record 4 my_clob=Data from record 4 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=46728&edit=1