SQL Loader - Lob File

> Database > Oracle Database

1 - About

How to load a lob file with sql loader

2 - Example

2.1 - Control File

SQL*Loader - (Parameter|Control) File

LOAD DATA 
INFILE 'sample.dat'
INTO TABLE person_table
FIELDS TERMINATED BY ','
(
   name      CHAR(20),
   ext_fname    FILLER CHAR(40),
   "RESUME"     LOBFILE(ext_fname) TERMINATED BY EOF
 )

where:

  • FILLER is a field that fill a variable named ext_fname. It takes the relative path from the sqlloader running directory to the file to load
  • RESUME is the lob column of the database
  • LOBFILE is a function that transform the file in a lob file where you can set the file characterset. See lobfile_spec for the complete syntax
Advertising

2.2 - Datafile (sample.dat)

Johny Quest,jqresume.txt,
Speed Racer,'/private/sracer/srresume.txt',

3 - Reference

db/oracle/sqlloader_lob.txt · Last modified: 2017/09/06 19:29 by gerardnico