Because of the project, you need to use the BFile field to store the image file, so some research is made. The actual file of the BFile field is stored in the file system, and the field is stored in the field. Bfile pair
Oracle is read-only and does not participate in transactional control and data recovery
Basic operations of BFile are as follows:
1. First, in the Oracle database, we create a directory alias for mapping file positioning pointers to text.
Parts system:
CREATE DIRECTORY 'TMPDIR' AS '/ TMP'; TMPDIR represents the logical directory name, '/ TMP' is an actual directory. Note that the directory Oracle should have read rights
Then authorize the Grant Read on Directory Bfile_Dir1 to Scott as needed; create a table Create Table BFileTest (ID Number (3), FName Bfile containing the BFile field;
Create a table with a blob field
Create Table BlobTest (ID Number (3), ABLOB BLOB; 2. Insert Data To use bFileName to make BFileTest Values (1, bFilename ('tmpdir', 'tmpte'); The parameter 1 of BFileName is the Directory name, the parameter 2 is the file name. Note: Insert this line is
A file positioning pointer map pointing to / TMP / TMPTEST is not the file itself.