Mega Code Archive

 
Categories / Oracle PLSQL Tutorial / Large Objects
 

Use the file named b_file txt and attach it to the myTable table in the col_bfile column

SQL> SQL> create table myTable   2  (key NUMBER PRIMARY KEY   3  ,col_blob BLOB   4  ,col_clob CLOB); Table created. SQL> SQL> INSERT INTO myTable (key, col_blob, col_clob)   2  VALUES (1, HEXTORAW('101F'), 'ZYXW'); 1 row created. SQL> SQL> ALTER TABLE myTable add (col_bfile BFILE); Table altered. SQL> SQL> UPDATE myTable   2  SET col_bfile = BFILENAME ('INFILE', 'b_file.txt')   3  WHERE key = 1; 1 row updated. SQL> SQL> drop table myTable; Table dropped. SQL>