I am trying to store images on a database. So I have created lob_table
CREATE TABLE lob_table (id NUMBER, doc BLOB); CREATE OR REPLACE DIRECTORY my_dir AS 'C:\temp'; DECLARE src_lob BFILE := BFILENAME('MY_DIR', 'example.jpg'); dest_lob BLOB; BEGIN INSERT INTO lob_table VALUES(1, EMPTY_BLOB()) RETURNING doc INTO dest_lob; DBMS_LOB.OPEN(src_lob, DBMS_LOB.LOB_READONLY); DBMS_LOB.LoadFromFile( DEST_LOB => dest_lob, SRC_LOB => src_lob, AMOUNT => DBMS_LOB.GETLENGTH(src_lob) ); DBMS_LOB.CLOSE(src_lob); COMMIT; END;
But in the directory about 90000 photos and each photo stored with its id name like a "1.jpg". How I can automate the process?
https://stackoverflow.com/questions/67342722/how-to-automate-image-storing-on-oracle-database May 01, 2021 at 11:51AM
没有评论:
发表评论