Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

invalid number in loading external tables

Uday_NJul 16 2020 — edited Jul 16 2020

Hi All,

           I have an issue while loading csv file into external tables.

My table emp ( emp_id number,emp_salary number) .

My Column values :

emp_id  emp_salary

1             500

2            300

i export the file from windows to DB server , When i run the external table script i face an invalid number issue . 

Things I have tried  :

1) In DB Server csv file look below

emp_id  emp_salary

1,             500

2 ,           300

If I add commas at the end of each line

emp_id  emp_salary

1,             500,

2 ,           300,

I am able to load data into table emp using external table script .

Also

2)  if i change the columns emp_id , emp_salary data type to varchar2  in the external table script . it worked and i am able to load the data  .

Why script reads excel values as string , why table not considering as number when i transfer from excel local to DB Server? Why when i add comma at end of each line in DB server csv file I am able to load data in table with number as data type?

Please kind your answers

This post has been answered by Solomon Yakobson on Jul 16 2020
Jump to Answer
Comments
Post Details
Added on Jul 16 2020
14 comments
1,465 views