Updating BLOB column
709491Nov 17 2009 — edited Nov 17 2009Dear all,
I have made a database procedure for inserting BLOB to database, using this code
-----
INSERT INTO CUST_SIGNATURE
(CUSTOMERID, SIG_NAME, MIME_TYPE, SIG_IMG)
VALUES
(p_custid, v_image_name, v_mime_type, empty_blob()) RETURN sig_img INTO b_lob;
f_lob := BFILENAME('SIG_SOURCE_DIR', p_filename);
dbms_lob.fileopen(f_lob, dbms_lob.file_readonly);
dbms_lob.loadfromfile(b_lob, f_lob, dbms_lob.getlength(f_lob));
dbms_lob.fileclose(f_lob);
COMMIT;
-----
Now i need to update the blob column with a new image.
The primary key for the table is combination of (CUSTOMERID, SIG_NAME).
I need to update the image for the selected (CUSTOMERID, SIG_NAME)
I searched in net. But couldnt get a proper answer.
Need something like this
-----
upate CUST_SIGNATURE
set SIG_IMG = to a blob
where customerid=p_custid, and sig_name= p_filename;
-----
Thanks in advance