Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I load numeric into char using SQL Loader

Status
Not open for further replies.

Tison

Programmer
May 12, 1999
216
CH
I have data consisting of various numeric fields (dec 8.2).
I want to load them into an Oracle table dropping the decimal and making them char(8).
My sql loader cntrl file defines them as ;
Field1 char "to_char:)field1,'99999999')"

But this does not work.
I get error ;
ORA-01401: inserted value too large for column

How do I go about this ?
 
Use SUBSTR

I tried this and it works.

Text File: (File Name LOAD_DATA.TXT)
1,99999999.99
2,99999999.99
3,99999999.99
4,99999999
5,99999999
6,99999999
7,99999999
8,99999999
9,99999999
10,99999999

CTL File:

LOAD DATA
INFILE 'LOAD_DATA.TXT'
INTO TABLE tbl_name
FIELDS TERMINATED BY ','
(fld_name1 CHAR,
fld_name2 CHAR "SUBSTR:)fld_name2,1,8)")


Regards,
OG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top