Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > Oracle > SQL-LOADER : loade data in a specific column

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-20-03, 11:35
jeromestettler jeromestettler is offline
Registered User
 
Join Date: Mar 2003
Posts: 3
SQL-LOADER : loade data in a specific column

Hello,

I am a beginner with SQL*Loader. I want to load a datafile with values only for one specific column. The destination table has 189 columns. The column 1 is the target (COL1). What I have to modify in the following control file ?

LOAD DATA
INFILE 'c:\test2.txt'
APPEND
INTO TABLE TEST_TABLE
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
( COL1
)

the datafile :

12234
12345
12346
12347

(sorry, my english is poor :-) )
regards
Jerome
Reply With Quote
  #2 (permalink)  
Old 03-20-03, 12:53
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 4,874
Re: SQL-LOADER : loade data in a specific column

It depends on what you want/need to put in the other 188 columns:
- if they can be NULL you can omit them (they will be set to NULL)
- if they are NOT NULL but have a DEFAULT you can omit them (they will be set to the DEFAULT)
- if they are NOT NULL and do not have a DEFAULT then you must specify a value.

In the last case, there are various options for specifying a value in the control file:

COL2 CONSTANT 'x',
COL3 RECNUM,
COL4 SYSDATE,
COL5 SEQUENCE (1)
...

See the SQL Loader Guide here for more details:

http://technet.oracle.com/docs/produ...06.htm#1008669
__________________
Tony Andrews
http://tonyandrews.blogspot.com
Reply With Quote
  #3 (permalink)  
Old 03-21-03, 05:42
jeromestettler jeromestettler is offline
Registered User
 
Join Date: Mar 2003
Posts: 3
Dear Andrewst,

many thanks for your help, Have a nice WE.

Jerome
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On