i have a table that has 3 columns
tablename: files
column names = fileno, files, ex1
fileno: number
files: longraw -> storages blob
ex1: varchar2(1)
there are a lot rows in table.. blobs.. files field has blob data. so i can read them, there is no problem here.
but i can t insert data to this table. this command works fine with toad:
insert into files values(123,rawtohex('123'),'');
but i must insert image binary data to files field. when i used rawtohex function with php, query fails after 4000 character.
php code:
<?php
include("conn.php");
$imagefile=file_get_contents("newpictimage.pict");
$s=oci_parse($conn,"insert into files
(fileno,files,ex1) values(
'123',EMPTY_BLOB(),''
) RETURNING files INTO :blobdata");
$lob = oci_new_descriptor($conn, OCI_D_LO😎;
oci_bind_by_name($s, ':BLOBDATA', $lob, -1, OCI_B_BLO😎;
oci_execute($s, OCI_DEFAULT);
$lob->save(imagefile);
oci_commit($conn);
?>
error message:
Warning: oci_execute() [function.oci-execute]: ORA-00932: inconsistent datatypes: expected BLOB got BINARY in ... -> "oci_execute line"
thanks for answers.
oracle8, php 5.1.2, solaris