Basic Oracle binary and big object types

Source: Internet
Author: User

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

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.