Re: When has Loader finished?

From: <mkrolewski_at_rosetta.org>
Date: Tue, 21 Nov 2000 19:50:49 GMT
Message-ID: <8vejmm$2f3$1_at_nnrp1.deja.com>


In article <8vea2u$p8f$1_at_nnrp1.deja.com>,   tim_bedford_at_my-deja.com wrote:
> Hi,
> I've got a C++ application that gets an ASCII file, uses Loader to
> squirt it into an Oracle table, and then compares it with another
 table
> in a search. The trouble is I can't figure out how to get the C++ app
 to
> know when Loader has finished doing its stuff. If I try and do the
> search immediately after calling Loader it gets nothing,
 understandably.
> The only thing I can think of is to count the number of lines in the
> ASCII file, then do a COUNT on the table, and not perform the search
> until they're the same. But there's got to be a better way than that.
> tahnks,
>
> Tim
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>

Not knowing your code, the normal method is to envoke the loader as a separate process but wait until the process completes.

For instance in MFC++ there is a function which starts separate processes as a separate fork eg CreateProcess(). After the process is started, one can then wait for the process to complete. Again in MFC++, there is a WaitForSingelObject() and GetExitCodeProcess() to detect that the process is completed and what if any codes are returned by that process. This will detect any process completion, even if the process completes prior to getting to the WaitForSingleObject() line of code.

Most system support some equivalent system -- most of the MFC++ design is copied from Unix.

Once the process is completed, you can then check the results of the loading. SQLLoader has a log file which tells you among other things how many rows were loaded and errors if any. You should be able to open and parse the file to determine if the load was successful.

At this point you can continue your processing.

Michael Krolewski

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Tue Nov 21 2000 - 20:50:49 CET

Original text of this message