Multiple File upload Thur Oracle SQL*Loader Program
Oracle SQL*Loader
Requirement:-
A FTP location having multiple file and we need to upload all files in system or any staging Table.
based on that we can write some validation/program/interface anything.
Restrictions:-
1. All file name must be known
2. All file must be exists on FTP location
Solution:-
1. Create A TABLE
2. Write a control file
3. Move that control file and excel files to particular $TOP/ .../Bin Folder or directories
4. Register Concurrent program
Type :- SQL* Loader
5. Run That program and check the data in to the table
See my video on my you tube Channel "ORACLE TECHNICAL SHOOTER"
1. Create Table Syntax:-
CREATE TABLE XXSD.XXSD_SQL_LOADER_TEST_TL
(
HDR_ID NUMBER,
EMP_NAME VARCHAR2(100 BYTE),
EMP_DEPT VARCHAR2(100 BYTE),
EMP_DATE VARCHAR2(100 BYTE),
CREATION_DATE DATE,
ORG_ID NUMBER
)
2. File :- .CTL
OPTIONS (SKIP=1)
LOAD DATA
INFILE '$XXSD_TOP/bin/XXSD_SQL_LOADER1.csv'
INFILE '$XXSD_TOP/bin/XXSD_SQL_LOADER2.csv'
INFILE '$XXSD_TOP/bin/XXSD_SQL_LOADER3.csv'
INSERT / REPLACE / APPEND / TRUNCATE ( Here we can use one of them as per requirment )
INTO TABLE XXSD.XXSD_SQL_LOADER_TEST_TL
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
(
EMP_NAME ":EMP_NAME" ,
EMP_DEPT ":EMP_DEPT",
EMP_DATE ":EMP_DATE",
HDR_ID "XXSD.XXSD_SQL_LOADER_TEST_SEQ.NEXTVAL",
REQUEST_ID "82",
CREATION_DATE SYSDATE
)
3. Move files to FTP Location :- /u /STG_APP/apps/apps_st/appl/xxsd/12.0.0/bin
4. Move files to FTP Location :-
after program completion
Friend My Youtube channel @ Oracle Technical Shooter
Comments
Post a Comment