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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Loader leading zeros

Status
Not open for further replies.

taz75

Programmer
Apr 17, 2001
15
GB
I have a field that contains leading zeros that I would like to load into a numeric field.

When I try and load it I get the following error:

Record 15846: Rejected - Error on table <table_name>, column <column_name>.
ORA-01722: invalid number

How can I get SQL Loader to accept that this is a number and load it into my table?

I have tried to "to_number" this field, but then I am not allowed to use DIRECT_LOAD.

Any advice would be appreciated.
Thanks
Laura
 
Hi, Laura

I do not believe you will be able to do this into Oracle as Oracle does not recognize numbers that begin with 0. It will only recognize these as character columns. Why would this column need to be a number?

Regards,


William Chadbourne
Oracle DBA
 
I am happy to lose the leading zeros when it is stored in my table.

As a work around I'll have to add a expression into the load and take off the DIRECT_LOAD option, but I was hoping that there was a better way.

Thanks for replying
Laura
 
I've found that this was actually a problem with the data, I stupidly assumed it would be in the format I had specified.

So in fact it does load data with leading zeros into numeric fields sucessfully.

Sorry,
Laura
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top