adspace
How to move the data from one flatfile to multiple staging
tables?give me some examples?
for example in po interface one flat file is there and
multiple staging tables are there how can move it?please
give me answer for this question?
Answer Posted / Vipin Kumar Divakar
In Oracle, you can use SQL*Loader to load a flat file into multiple staging tables. Here's an example:
First, create the control file with the following structure:
```
OPTIONS (SKIP=1)
LOAD DATA
INFILE '<flat_file_location>'
APPEND
INTO TABLE <staging_table_1>
FIELDS TERMINATED BY ','
(
field1 CHARACTER SET ascii,
field2 CHARACTER SET ascii,
...
)
LOAD DATA
INFILE '<flat_file_location>'
APPEND
INTO TABLE <staging_table_2>
FIELDS TERMINATED BY ','
(
field1 CHARACTER SET ascii,
field2 CHARACTER SET ascii,
...
)
...
```
Replace `<flat_file_location>` with the location of your flat file and add more control statements for each staging table you want to load data into. Then run the SQL*Loader using the control file.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers