Discussion Locked

Load numbers into Oracle

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I have an ascii file which I load with a control file. I have delimiters which are supposed to distinguish between characters and numbers. My problem is I can never load the numbers in as numbers. I always have to define them as characters because it simple will not take the numbers. Please shed some light on my procedure. Thank you in advance!

5 replies

by tech geek

You don't have to define the fields with the SQL Loader it will determine the datatype. One exception is dates, but here is an example of a control file:

LOAD DATA
INFILE '/tmp/datafile.txt'
BADFILE '/tmp/datafile.bad'
DISCARDFILE '/tmp/datafile.dsc'
INTO TABLE users
FIELDS TERMINATED BY '|'
TRAILING NULCOLS
(
id,
first_name,
last_name,
password,
created_date DATE(8) "MM/DD/YY"
)

by d. brinson

It depends on how you are trying to load the data. Are you using the Data Loader or are you using some other utility? One thing that I would make sure of is that there are not any leading or trailing spaces between the delimiters and your number. That could be causing the loader (or utility) to believe that the field is text.

This discussion is closed to new replies.