Call BFILENAME to get pointer to a BFILE : bfile « Large Objects « Oracle PL / SQL






Call BFILENAME to get pointer to a BFILE

  
SQL>
SQL> CREATE TABLE lobdemo (
  2    key NUMBER,
  3    bfile_col BFILE);

Table created.

SQL>
SQL>
SQL> DECLARE
  2    v_BFILE1 BFILE;
  3    v_BFILE2 BFILE;
  4  BEGIN
  5    v_BFILE1 := BFILENAME('code', 'file1.c');
  6    v_BFILE2 := BFILENAME('code', 'file2.c');
  7
  8    INSERT INTO lobdemo (key, bfile_col)
  9      VALUES (12, v_BFILE1);
 10
 11    UPDATE lobdemo
 12      SET bfile_col = v_BFILE2
 13      WHERE key = 10;
 14
 15    COMMIT;
 16  END;
 17  /

PL/SQL procedure successfully completed.

SQL>
SQL>
SQL> drop table lobdemo;

Table dropped.

SQL>
SQL>

   
  








Related examples in the same category

1.Create the BFILE directory
2.Two locators pointing to the same file
3.Insert value to bfile column
4.BFILE File Operations
5.BFILE Comparisons
6.BFILENAME function