|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-01-29 09:21 UTC] tony2001@php.net
[2004-01-29 11:16 UTC] ceco at noxis dot net
[2004-01-29 11:46 UTC] tony2001@php.net
[2004-02-04 03:55 UTC] tony2001@php.net
[2004-02-04 05:37 UTC] ceco at noxis dot net
[2004-05-22 11:42 UTC] nlopess@php.net
[2004-09-17 14:48 UTC] vrana@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 13:00:01 2025 UTC |
Description: ------------ first of all I should say that it may be documentation problem, because didn't find good documentation of the LOB object i have a oracle procedure, which accepts BLOB (see the code below) it inputs the data in the blob but when i extract (with the oracle tools or with other php script) it is corrupted it is exactly 2 times larger when everything is changed to clob (of course the data is text not jpg), this function work ok also it is workig for me if I use insert into (the_blob) values (empty_blob()) returning the_blob into :the_blob and then bind $lob and use $lob->save but i don't want to have this I think $lob->WriteTemporary mangles the data somehow and corrupts it Reproduce code: --------------- include_once 'config/environment.inc.php'; $fd = fopen('Sample.jpg', 'r'); $data = fread($fd, filesize('Sample.jpg')); fclose($fd); $conn = ocilogon($CFG_DB['username'], $CFG_DB['password'], $CFG_DB['db']); $lob = OCINewDescriptor($conn, OCI_D_LOB); $stmt = OCIParse($conn,"begin TEST_PROC(:the_blob); end;"); OCIBindByName($stmt, ':the_blob', &$lob, -1, OCI_B_BLOB); $lob->WriteTemporary($data); OCIExecute($stmt, OCI_DEFAULT); $lob->close(); $lob->free(); OCICommit($conn); create procedure TEST_PROC(the_blob blob) is begin insert into test_table values (the_blob); end; create table test_table (the_blob blob);