Test-use SQL Lorader to import lob data, loraderlob

Source: Internet
Author: User
Tags sql loader

Test-use SQL Lorader to import lob data, loraderlob

1. Prepare the data file to be transferred and transfer it to the server

2. Create a target table in the database

DROP TABLE lob_tab;CREATE TABLE lob_tab (  number_content    NUMBER(10),  varchar2_content  VARCHAR2(100),  date_content      DATE,  clob_content      CLOB,  blob_content      BLOB);

3. Compile the control file for SQL Loader (Name: lob_test.ctl)

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)

It is worth noting that the filename field is defined as the FILLER type, which provides LOBFILE information during transmission and does not pass in to the database.
4. Use the following command to import data to the database

sqlldr userid=test/test@db10g control=lob_test.ctl log=lob_test.log bad=lob_test.bad

After the command is executed using explain Term, the import is successful.

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.