How to insert data into two tables using single control file?
Answers were Sorted based on User's Feedback
Answer / rajiv
LOAD DATA
APPEND
DISCARDMAX 9999999
INTO TABLE UPLOAD_HDR
WHEN agreementno='~'
FIELDS TERMINATED BY ","
(
AGREEMENTNO CHAR(20),
FILENAME CHAR(30),
BATCHID constant 112)
INTO TABLE UPLOAD_TMP
WHEN agreementno <>'~'
FIELDS TERMINATED BY ","
TRAILING NULLCOLS
(
AGREEMENTNO POSITION(1) CHAR(20),
EMI_AMT INTEGER EXTERNAL(16),
BATCHID constant 112)
| Is This Answer Correct ? | 10 Yes | 1 No |
Answer / emmanuel - tcs
A Small changes in above control file
Add below insert stmt to above CTL File
Insert into Table Tab_name_1 -- This is for one table
Insert into Table Tab_name_2 -- This is for Second Table
First mention first table column and mention second table
columns
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / bobbyiiit
Using "When"
we use "When" condition to load data into multiple tables.
Syntax:
Load Data infile '&1'
Insert into table table1
(
.
.
.
.
)
Insert into table table2
when <condiation>
(
.
.
.
);
| Is This Answer Correct ? | 1 Yes | 0 No |
Who information?s?
If we have a repeated record in a table. But the repeated record how i can transfer from table to nested table?
wht is the use of Xml reports over reports6i?
what is difference between po_headers_all and po_headers
in procedure how to return a value
Write an SQL Query to Delete Duplicate records from a table using ROWID.
24 Answers pspl, Satyam, Thinkways,
How to make Parameter as Mandatory?
what is the difference between procedure and function
How to pass data into EXECUTE_IMMEDIATE statement in plsql body ?
in sql loader,i have 100 records in my flatefile, i want to skip the 80 to 90 records .please help me
What do you understand by a set of books?
What is an Index , Types od index why we are use index.