Insert into multiple tables [message #73219] |
Thu, 04 March 2004 04:15 |
sri
Messages: 154 Registered: February 2000
|
Senior Member |
|
|
Hi,
I have gone through the the topic "Can one load data into multiple tables at once?" But I am facing problem in inserting the data. My problem is that I have to insert the data from a text file in two tables simultaneously one in insert mode and another in append mode. I used the same syntax but I am only getting data in one table(first one). The code which I wrote is:
LOAD DATA
INFILE 'abc.txt'
REPLACE
INTO TABLE MainTable
when (ID!='RAGER')
fields terminated by "|"
optionally enclosed by '"'
trailing nullcols
( ID "'GER'||UPPER(:ID)",
NAME CHAR,
status "decode(:status,null,'NEW','NEW')",
PROCESS_STATUS "decode(:PROCESS_STATUS,null,NULL)"
)
INTO TABLE BulkTable
when (ID!='RAGER')
fields terminated by "|"
optionally enclosed by '"'
trailing nullcols
( ID "'GER'||UPPER(:ID)",
NAME CHAR,
status "decode(:status,null,'NEW','NEW')",
PROCESS_STATUS "decode(:PROCESS_STATUS,null,NULL)"
)
How can I insert same data into two tables. One in insert mode and another in append mode. I tried Insert and Append keywords also but to no success. Please help me with this.
Thanks,
Sri
|
|
|
|
|