文档地址:http://docs.oracle.com/cd/E11882_01/appdev.112/e10646/oci03typ.htm#LNOCI16268
RAW
The RAW
data type is used for binary data or bytestrings that are not to be interpreted by Oracle Database, forexample, to store graphics character sequences. The maximum lengthof a RAW
column is 2000 bytes.
See Also:
OracleDatabase SQL Language ReferenceWhen RAW
data in an Oracle Database table isconverted to a character string in a program, the data isrepresented in hexadecimal character code. Each byte of theRAW
data is returned as two characters that indicatethe value of the byte, from '00' to 'FF'. To input a characterstring in your program to a RAW
column in an OracleDatabase table, you must code the data in the character stringusing this hexadecimal code.
You can use the piecewise capabilities provided byOCIDefineByPos()
, OCIBindByName()
,OCIBindByPos()
, OCIStmtGetPieceInfo()
,and OCIStmtSetPieceInfo()
to perform inserts, updates,or fetches involving RAW
(or LONG
RAW
) columns.
If you are using objects in an Oracle database, you can workwith a special OCIRaw
data type using a set ofpredefined OCI functions. See "Raw (OCIRaw)" for more information about this data type.
LONG RAW
The LONG
RAW
data type is similar tothe RAW
data type, except that it stores raw data witha length up to 2 gigabytes (2^31-1 bytes).
BFILE
Data Type The BFILE data type enables access to binary file LOBsthat are
stored in file systems outside Oracle Database. A BFILE columnor attribute
stores a BFILE locator, which serves as a pointer to a binaryfile on the
server file system. The locator maintains the directory name andthe filename.
You can change the filename and path of a BFILE withoutaffecting the base
table by using the BFILENAME function. Refer to BFILENAME formore information
on this built-in SQL function.
Binary file LOBs do not participate in transactions and are notrecoverable.
Rather, the underlying operating system provides file integrityand durability.
BFILE data can be up to 264-1 bytes, although your operatingsystem may impose
restrictions on this maximum.
The database administrator must ensure that the external fileexists and that
Oracle processes have operating system read permissions on thefile.
The BFILE data type enables read-only support of large binaryfiles. You cannot
modify or replicate such a file. Oracle provides APIs to accessfile data. The
primary interfaces that you use to access file data are theDBMS_LOB package
and Oracle Call Interface (OCI).