Built table: CREATE TABLE IMAGE_LOB (T_ID VARCHAR2 (5) NOT NULL, T_IMAGE BLOB NOT NULL); built directory: CREATE OR REPLACE DIRECTORY IMAGES AS 'C: / Oracle'; remodeling process: CREATE OR REPLACE PROCEDURE IMG_INSERT (TID VARCHAR2, FILENAME VARCHAR2) AS F_LOB BFILE; B_LOB BLOB; BEGIN INSERT INTO IMAGE_LOB (T_ID, T_IMAGE) VALUES (TID, EMPTY_BLOB ()) RETURN T_IMAGE INTO B_LOB; F_LOB: = BFILENAME ( 'IMAGES', 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;
Our: http://www.itpub.net/350868.html