Friday, March 1, 2013

Upload Data into Table using SQL*Loader in Oracle Apps

Upload Data into Table using SQL*Loader in Oracle Apps

For SQL*Loader we need
control file
badfile
discardfile
and a data file which has data to be uploaded. We create a table : employee, in which data has to be uploaded

create table employee(eid number(3),ename char(20),dept char(20));

save below code as main.ctl
LOAD DATA
INFILE '$1'
APPEND
INTO TABLE employee
FIELDS TERMINATED BY ','
(
eid integer external,
ename char,
dept char
)
below is the data file and save it as file.txt
999,ram,cse
101,vee,mpc
201,haa,bipc

Now control file and datafiles are ready. We need to create a concurrent program for this.
Place the control file in custom top, $XX_TOP/bin and mention data file path in the parameter form of the concurrent program. Create an executable
pic
Create a concurrent program with a parameter which has the datafile path
pic1 Pic3
Attach to a request group and run the program.

No comments:

Post a Comment