Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparing data in SQL Loader

Status
Not open for further replies.

cidoni

Programmer
Feb 10, 2003
3
US
Is there anyway to compare two rows of data inside the control file of sql loader.
For eg:
I have a data file like this

"Tom","Cat"
"Tom","Cat"
"Jerry","Mouse"
"Pluto","Dog"

In the control file, I want to check whether the previous row is same as the current row. Depending on that I might want to do a different operation.

Can this be achieved? If yes, how?
 
I'd suggest you to load into some staging table and then "distribute" your data acoording to your needs using sql or pl/sql. Another way is to disable constraint and process duplicates before enabling it again. Regards, Dima
 
My requirement is to insert the data to a different table if the two rows are same. So, I need to to compare the data of the two rows. Is this possible?
 
As sem was saying, you will have to load the data in a staging table using sqlloader then use a pl/sql script or sproc to update your production data from the staging table.

Personally, I do not like the disabling of constraints in an automated task. If they don't get re-enabled, you are running with your shields down at that point.

Chris.
 
If you have Oracle 9i use external tables to examine data. Stick to your guns
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top