Oracle Tips by Burleson Consulting
supports a data type called a BFILE. This binary file is
stored in the external operating system file system. Oracle
stores a pointer to this file rather than storing the actual file in
the database. If for some reason you did not want to store
your binary file in the database, this would be the way to do it.
EnterpriseDB does not support BFILE.
NUMERIC data types section, I spoke about a special data type called
an OID. The OID can be used as an indicator. If you
create a column of OID type, you can use a special function called
lo_import, which means Large Object Import, to associate a binary
file with an OID. There are other functions that operate on
large objects that I discuss in the section on Binary SQL Functions
you use large object support via the "lo" functions, you store all
of your large objects in a common large object table. I would
recommend that you stick with BLOBs when you need to store binary
large objects and TEXT when you need to store character large
objects. The "lo" functionality is available should you need
it for some reason.
could mimic BFILEs with this functionality. You could
encapsulate the BFILE style access in your own procedures and "load
from file" or "save to file" by calling "lo" routines. I will
show an example of this in a later section.
now, you can create a binary data types table and manipulate some
CREATE TABLE binary_table (
lob_binary OID );
INSERT INTO binary_table ( my_binary, lob_binary )
VALUES ('\\000\\001\\002\\003\\000', lo_import('c:\\temp\\picture1.jpg')
SELECT my_binary, lob_binary
edb=# CREATE TABLE binary_table (
edb(# my_binary BLOB,
edb(# lob_binary OID );
edb=# INSERT INTO binary_table ( my_binary, lob_binary )
edb-# VALUES ('\\000\\001\\002\\003\\000',
INSERT 0 1
edb=# SELECT my_binary, lob_binary
edb-# FROM binary_table;
\000\001\002\003\000 | 16685
insert above will insert the picture, "picture1.jpg", which is in
the c:\temp directory, into a common large object table in the
database. It will create an OID reference, which is stored in
the lob_binary column of the binary_table table.
are no synonyms that are equivalent to an OID in this instance.
is an excerpt from the book "EnterpriseDB:
The Definitive Reference" by Rampant TechPress.