|
-
Hi Nedpan,
Still it's confusing us! Any way i will give u some steps how to complete a to z steps.
The first one!
Flat file:
Flat file is nothing but a text file which data contains in one format.
For ex:
empno ename job sal or
empno|ename|job|sal or
empno,ename,job,sal
When somebody sending the flat file they will tell you the
table details
data format details.
bases on that you will create a control file and you will load data into temp table. Once you loaded into the temp table you will do appropriate changes to your table data and load into one production table or multiple production tables.
This is the process. I am not understanding exatly what you are doing. If you tell us what you are planing to do then i can send u the scripts.
The next one:
Weekly basis if you get data from database a and if you want to load data into database b, Then you can create a database link and you can complete your job. If you have problem with that and if you want to use sqlldr then you have to follow these steps.
1. Pull data from database A by using dynamic sql statements into text file.
for ex:
set heading off
spool temp.dat
select empno||'|'||ename||'|'||job||'|'||sal from emp;
spool off;
In this statement we are using "|" as a delimiter. If you want you can change this one. Now you have data in temp.dat .
2. write a control file and use temp.dat infile and use fields terminated by "|". The first four lines will go like this
LOAD DATA
INFILE 'temp.dat'
INTO TABLE temp_emp
fields terminated by "|"
following by field names.
3. Now data is there in database B. You can write a sql statement and copy data from temp_emp to production table or tables.
This is the process. If you give me more details then i can give u some more information. Good Luck
sree
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|