diff --git a/functions/oci8.xml b/functions/oci8.xml index 4593e35844..915ae0d8cb 100644 --- a/functions/oci8.xml +++ b/functions/oci8.xml @@ -260,7 +260,13 @@ OCILogoff($conn); records just after the insert. */ -$conn = OCILogon("scott","tiger"); +$conne { + // $lob_upload contains the temporary filename of the uploaded file + $conn = OCILogon($user, $password); + $lob = OCINewDescriptor($conn, OCI_D_LOB); + $stmt = OCIParse($conn,"insert into $table (id, the_blob) + values(my_seq.NEXTVAL, EMPTY_B += OCILogon("scott","tiger"); $stmt = OCIParse($conn,"insert into emp (empno, ename) ". "values (:empno,:ename) ". @@ -769,7 +775,7 @@ Upload file: <input type="file" name="lob_upload"><br> $stmt = OCIParse($conn,"insert into $table (id, the_blob) values(my_seq.NEXTVAL, EMPTY_BLOB()) returning the_blob into :the_blob"); OCIBindByName($stmt, ':the_blob', &$lob, -1, OCI_B_BLOB); - OCIExecute($stmt); + OCIExecute($stmt, OCI_DEFAULT); if($lob->savefile($lob_upload)){ OCICommit($conn); echo "Blob successfully uploaded\n";