Oracle binary type and big object type basics 1. type differentiation NCLOB stores single-byte character data CLOB stores multi-byte character data BFILE stores the pointer to the binary file in the OS file system, files are not stored in the database. BLOB stores binary data RAW stores fixed-length binary data. You need to define the length, for example:
create table t(s raw(2000);
Long raw stores variable-length binary data. 2. Use of data types in Databases
NCLOB create table t (id int, cont NCLOB); Insert into t (id, cont) values (1, 'Hello'); select * from t; id cont ------------------------- 1 hello CLOB is the same as NCLOB. BLOB cannot be directly inserted. BFILE Conn lyy/lyy Create table bfiletable (id int, obj BFILE); Create or replace directory dir AS 'd: \ '; Conn/as sysdba Grant read directpry dir to lyy; conn lyy/lyy Insert into bfiletable (id, obj) values(1,filename('dir', '1.jpg '); Select * from filetable; id obj limit 1 filename ('dir', '1. JPG ') RAW Create table rawtable (id int, obj raw (2000); Insert into rawtable (id, obj) values (1, uti_raw.cast_to_raw ('hello ')); select * from rawtable; id obj ----------------------------------------------- 1 68656C6C6F long raw Create table lrawtable (id int, obj long raw); Insert into lrawtable (id, obj) values (1, uti_raw.cast_to_raw ('hello'); Select * from lrawtable; id obj ------------------------------------------------- 1 6