If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Hi,
I have a control file, did use sqlldr to load my temp table. Do not know how to create the flat file nor the steps to take in order to distribute the temp's table data to the apropriate tables. Any help will be greatly appriciated.

I'll gladly help you, but I'll need more information. I'm not sure what you need help with.

1. You state that you have a control file and did use sqlldr to load your temp table. At this point, I assume all you data from you external data source is in a table in your Oracle database.

2. You then state that you do not know how to create the flat file. This implies you have not yet created a text file to upload using sqlldr. Thus it appears this statement is in direct conflict with #1.

3. You finally state that you do not know the steps to distribute the temp table data to the appropriate tables. Again, this seems to make sense with statement #1, but be in conflict with statement #2.

So, my questions are:

Have you loaded data into your Oracle database using sqlldr?

If so, what do you want help with?

If not, how is the "old" data stored now? Do you know how to output it to a text file? What is the data structure of the old data? Do you want to maintain an identical structure in the Oracle database? If not, what is the desired new structure?

I have a temp table called "X" that is loaded with data using sqlldr. My problem is the distribution of the data in table "X" to all the other tables where it is supposed to go. Also on weekly basis I will have to get data from database "A" using sqlldr and put it in database "B". I was thinking of using SQLLDR for that. One last thing, what I do not understand is the process from [a] to [z]. The steps I need to take to have the import/export between the databases, tables, etc.. automized.

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

You stated that you don't know how to "do appropriate changes" to your table data. Do you mean you need help designing the structure of the production tables, or that there is an actual data conversion problem, such as date formats or case restrictions? What else do you need?

Thank you for the information.
I am still having some problems. Will give you the details again - maybe I missed something the first time.

I have 2 databases.
DB1 & DB2.
There is data that is going once a week into DB1. This data i have to capture and populate a table (table 'A') in DB2.
Once table 'A' is populated I need to store the old data into tables in DB2. For example:
given_name in table'A' used to be 'y', but after the update is now'x'. I have to take 'y' and put it into another table so that it is stored and accessible if needed.

What I have so far done:
I have a dblink between DB1 and DB2.
I have a temp table called 'B' that has the fields from the six tables in DB1 that I want to take the data from.

Out of the above table I only need to get client_id, sex,region_code,province,client_type, api,pilot_id.
I have five more tables similar to the one above that I need to do the same thing with.
If I get pass this problem then the only other one is once my temp table ('B') is populated how do I transfer the data from table 'B' over to table'A'. Keep in mind 'A' is in DB2 and 'B' is in DB1.

I trully hope you can assist me in completing my task. Also to what extend can I use EZSQL to complete the above requirements.