Home » SQL & PL/SQL » SQL & PL/SQL » Running for multiple countries (oracle 11G)
icon5.gif  Running for multiple countries [message #347437] Thu, 11 September 2008 11:45 Go to next message
gyankr
Messages: 11
Registered: January 2008
Junior Member

We are trying to load some data from flat file to a particular table in our db.We are getting feeds separately for US and CA.

When the job for US runs it synchornizes the feed file with the db for US records and deactivates the records which do not exist in the feed file for US(Note the records for CA are untouched in the db).

The same applies for CA job.

The problem we are facing currently is the feed for US has some records for CA and this results in deactivation of missing records for CA in the db.

We do not want to deactivate records for CA even it exists in the feed while running the job for US,but we want the those set of records to be processed while running feed for CA.

The problem is where do i store those records for CA (make is persistant somewhere) and process them while running for CA

The same applies for feed in CA may have records for US which has to be processed while running feed for US.

Any thoughts?

Regards,
Gyan
Re: Running for multiple countries [message #347445 is a reply to message #347437] Thu, 11 September 2008 12:14 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
This is how I understood the problem: there are two files: one for US, one for CA.
US file contains both US and CA records.
CA file contains both US and CA records.

You want to process US records separately from CA records.

If you use SQL*Loader, you could distinguish the two in the WHEN clause (I believe there must be some indicator which tells you which records belong to US and which to CA).

If you choose to use external tables feature - perhaps a good idea - you could process only US (or CA) records in a very simple manner, as you'd use the US/CA indicator in the WHERE clause (of a SELECT statement) which would select only US records when processing US, and select only CA records when processing CA.
Re: Running for multiple countries [message #347563 is a reply to message #347437] Fri, 12 September 2008 02:53 Go to previous messageGo to next message
gyankr
Messages: 11
Registered: January 2008
Junior Member

Yes we can reject the records for CA in sql loader while running for US but how do i retrieve them while running for CA?
Re: Running for multiple countries [message #347567 is a reply to message #347563] Fri, 12 September 2008 03:01 Go to previous message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Load both files, one after another.
Previous Topic: varchar to number
Next Topic: Forall statement
Goto Forum:
  


Current Time: Thu Feb 06 23:37:27 CST 2025