I have tried serveral methods to attempt to get binary documents loaded into an Oracle 9i database as BLOB's. Each time I attempt to return an oracle bind variable and assign it to a php variable I recieve the following Oracle error:
01036, 00000, "illegal variable name/number"
// Cause: Unable to find bind context on user side
// Action: Make sure that the variable being bound is in the sql statement.
This happens when I use either of the following methods:
SELECT DOC INTO :the_blob FROM DOC_LOB WHERE DOC_ID = 43 FOR UPDATE OF DOC
OR
INSERT INTO DOC_LOB VALUES(EMPTY_BLOB()) RETURNING DOC INTO :the_blob
This is some of the php output:
OCIDebug: oci_parse "SELECT DOC INTO :the_blob FROM DOC_LOB WHERE DOC_ID = 43 FOR UPDATE OF DOC" id=16 conn=11
OCIDebug: oci_new_desc 17
Warning: OCIBindByName: Error while trying to retrieve text for error ORA-01036 in /export/htdocs/div_its/isg/doco/add_doco.php on line 107
OCIDebug: oci_new_desc 18
OCIDebug: OCIsavedesc: size=76288 offset=1
Warning: OCILobWrite: OCI_INVALID_HANDLE in /export/htdocs/div_its/isg/doco/add_doco.php on line 114
Couldn't upload Blob OCIDebug: START _oci_stmt_list_dtor: id=16 last_query="SELECT DOC INTO :the_blob FROM DOC_LOB WHERE DOC_ID = 43 FOR UPDATE OF DOC"
Many Thanks,
Brad.