Learning from Oracle Database 1

Source: Internet
Author: User

Common basic types of 1.oracle databases

CHAR (Ten)--store a fixed-length string

VARCHAR2 (Ten)--storing variable-length strings

Date

integer-to-store integers

Number (p,s)-->p the maximum number of digits that can be saved to the database, including the integer and fractional parts of the decimal point, and the number of digits reserved by S decimals

Example: Numbers that are actually stored by the number entered

Number 1234.567 1234.567

Number (6,2) 1234.567 1234.56

Number (6,2) 12345.67 the length of the input exceeds the maximum number of digits stored, error

2. Large object LOB can store 128TB of data

1) LOB has the following 4 types

CLOB, character lob type, for storing character data

Nclob--> national language Character set LOB type, for storing non-English characters

BLOB-to-binary LOB type for storing binary data

bfile--> binary file type for storing file pointers. The text itself does not exist in the database, and the database stores only a pointer to the file.

2) How to use?

Creating table: CREATE TABLE Test (ID integer primary key,

Clob_col clob not NULL);

Insert data: INSERT INTO Test (ID,CLOB_COL) VALUES (1, to_clob (' Form day to day ... '));

Modify data: Update Test Set clob_col = To_clob (' What's it ... ')

Initialize Clob:insert into Test (Id,clob_col) VALUES (1, Empty_clob ());

When using bfile, you need to create a directory that represents the directory where the file is stored in the file system.

Create directory Test_file as ' C:\windows\file\ ';

Populate bfile Columns: INSERT INTO Test (ID,BFILE_COL) VALUES (1, bfilename (' Test_file ', ' textcontent.txt '));

However, when using large objects in PL/SQL, you can use the Dbms_lob package that comes with the Oracle database.

Learning from Oracle Database 1

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.