Mega Code Archive

 
Categories / Oracle PLSQL Tutorial / Large Objects
 

BFILE column and directory

SQL>  CREATE TABLE myBFile   2  (id NUMBER PRIMARY KEY,   3   bfile_data BFILE); Table created. SQL> SQL> CREATE DIRECTORY bfile_dir AS 'c:\proj'; SQL> SQL> DECLARE   2    bfileValue BFILE;   3  BEGIN   4    INSERT INTO myBFile VALUES (1,BFILENAME('BFILE_DIR','test.bmp'));   5    SELECT bfile_data   6    INTO bfileValue   7    FROM myBFile   8    WHERE id = 1;   9  10  END;  11  / PL/SQL procedure successfully completed. SQL> SQL> drop table myBFile; Table dropped. SQL>