Loading data from external files (like .xls) into Staging table.
In the following example we will use Excel file as our data source and insert it's data into
Staging table using Oracle Apps environment.
Lets start the process step by step,
1.You need a Excel file containing your source data.
For example we have two excel files
a. INVOICE_HEADERS.xls
b. INVOICE_LINES.xls
2. What we need is .csv file (comma separated value file) from this .xls file
So "Save As" the Excel file by selecting Other Formats option and choose the
Save As type : CSV (Comma delimited).
Now you are having two .csv files one each for .xls(excel files)
For example a: MAD_INVOICE_HEADERS.csv
b: MAD_INVOICE_LINES.csv
3. We need two tables (Staging tables) to store and hold the data in database
Following Query will create the table
So now we have two Staging tables ready in database to get filled with data.
For example a: XXMAD_AP_INVOICES_INTERFACE
b: XXMAD_AP_INVOICE_LINES_INTF
4. Create a (.ctl) control file which plays an important role to insert / append or do any
operation on the staging table by using the data which was in .xls file and now which is
converted in .csv files.
Steps to create control file (.ctl)
a. Open a notepad and write the ctl code in it,
For eg.
After writing the code in notepad Save it with .ctl extension
For example a: MAD_INVOICE_HEADERS.ctl
b: MAD_INVOICE_LINES.ctl
5. Now we need to move our .csv and .ctl files to middle tier (Application tire)
use WinSCP to move files.
In our case we have 4 files needs to be moved under the the
CUSTOM_TOP -> Bin folder
6. Concurrent Program needs to be created in Oracle Apps
Steps,
a: Create an Executable (System Administrator-> Concurrent-> Program->Executable)
Note: Execution Method should be SQL*Loader and Execution File Name must
be the name of control file (.ctl) don't give any extension to it.
b: Define a Concurrent program
Note: Keep the Short Name of Executable (in above step) and Short Name of this
Concurrent Program same
c: Now add this Concurrent Program to Request Group of your Responsibility.
d: Now Submit Request through your Responsibility
(View->Requests->Submit a New Request)
Write your Concurrent Program name and click submit button
7. Check your Staging tables data is inserted in those tables.
Thus by following these easy steps one can transfer data from external files into Staging tables.
Thanks,
Sudhir Bhilar