Hi,
I having some problems with my BLOB/BFILE upload code. Previously I had Red Hat 7.0, PHP 4.0.6 and Oracle 8.1.6.x setup and I had some code (basically from all the examples floating around and on php.net) that would insert a BLOB into a table.
After upgrading to Oracle 9i (9.0.1), Red Hat Linux 7.2, Apache 1.3.22, and PHP 4.1.1 all of my php/oci8 code works except for updating/inserting LOB columns. Reads from LOB columns seem to work ok. What happens when I try to insert a LOB is that it hangs during the statement execution. ( OCIExecute($stmt,OCI_DEFAULT) ) Eventually IE comes back with page could not be found.
I find that if I do an SQL trace on the database the insert statement seems to be parsed but after that there is no more activity and the record does not insert (or it might but since the execute does not return it can't be committed).
Any ideas what is wrong? I should also mention that the apache server is behind a firewall/router but I am having the problem whether or not my client is inside or outside the firewalled network.
In case it might be useful, here is my upload code that I'm using for testing..
$conn = OCILogon('user','pass','mydb');
$lob = OCINewDescriptor($conn, OCI_D_LOB);
$stmt = OCIParse($conn,"insert into blob_test (id, myfile)
values(3, EMPTY_BLOB()) returning myfile into :the_blob");
OCIBindByName($stmt, ':the_blob', &$lob, -1, OCI_B_BLOB);
OCIExecute($stmt,OCI_DEFAULT)
if($lob->savefile($lob_upload)){
OCICommit($conn);
echo "Blob successfully uploaded\n";
}else{
echo "Couldn't upload Blob\n";
}
OCIFreeDesc($lob);
OCIFreeStatement($stmt);
OCILogoff($conn);
Any help or suggestions would be appreciated. Thanks!
Peter