Oracle Data Loader takes Data from any external file. Here I'll perform Oracle Data Loader from an excel file (CSV Format).
First make an excel file. Check the Image. Kindly save it in CSV format. I have saved the Excel File as 'Emp_Info.csv' as destination 'E:\Ex_Dir\Emp_Info.csv'
First make an excel file. Check the Image. Kindly save it in CSV format. I have saved the Excel File as 'Emp_Info.csv' as destination 'E:\Ex_Dir\Emp_Info.csv'
After making Excel Sheet, Connect to SysDba to make directory and also to give the privileges to any common user for read and write the directory. Mostly Scott and other Users unable to make directory and read, write it because of less priveleges.
Conn sys/oracle as Sysdba;
Create Directory EXDIR as 'E:\Ex_Dir';
You can give any name as Directory name but make sure the destination would be the same where you have saved the excel sheet like (as 'E:\Ex_Dir')
After that give the rights to any user you want.
Grant All on Directory EXDIR to Scott;
or
GRANT READ, WRITE ON DIRECTORY EXDIR TO SCOTT;
Now Connect to Scott.
& Write the following Code.
CREATE TABLE EX_ABC
(
ID NUMBER,
FNAME VARCHAR2(20),
JOB VARCHAR2(20)
)
ORGANIZATION EXTERNAL
(
TYPE ORACLE_LOADER DEFAULT DIRECTORY EXDIR
ACCESS PARAMETERS
(
FIELDS TERMINATED BY ','
)
LOCATION ('EMP_INFO.csv'))
The Attributes should be in the same manner/format datatype like your excel sheet.
Here (FIELDS TERMINATED BY ',') indicates that you have made comma separated file,
LOCATION ('EMP_INFO.csv')) indicates your excel file name.
Thank you. . . !!
Have a Nice Day...!!!!
