Use sqlldr to import BLOB Data

Source: Internet
Author: User

We all know that lob data processing is very annoying. After the database design is complete, we often need to load test data, which is also annoying for lob. We can use SQL * loader to implement it, following is the control file:
Load data
Infile *
Into Table big_table
Replace
Fields terminated by X '09' optionally enclosed '"'
Trailing nullcols
(
XX _ id integer external,
Xx_name char,
Video_file filler char,

Video lobfile (video_file) terminated by EOF nullif value_file = 'null'

)

Begindata
1 matrix3 martrix3.mpg
2 "Lord of Ring" ring3.avi
3 "Top 10 of Week" top10_3.ra

Note:
Filler is the reserved word of loader, indicating that video_file is a variable instead of a field name. filler char indicates a string variable, which is used for subsequent lobfile
Lobfile is the loader function, indicating that the value of this field is obtained from lobfile

Terminated by EOF indicates that each lob field in each row comes from an independent File

==============

Supplement:

LOAD DATA INFILE 'lob_test_data.txt'   INTO TABLE lob_tab   FIELDS TERMINATED BY ','   (number_content    CHAR(10),    varchar2_content  CHAR(100),    date_content      DATE "DD-MON-YYYY" ":date_content",    clob_filename     FILLER CHAR(100),    clob_content      LOBFILE(clob_filename) TERMINATED BY EOF,    blob_filename     FILLER CHAR(100),    blob_content      LOBFILE(blob_filename) TERMINATED BY EOF)

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.