try... catch.. issue

Visi

Member
Hi,
I am writing a small code in BCB 6 to insert data into a table (Import utility) using TOracleQuery.
I have the following code included in a "for" cycle.

try
{
frmDataModule->OracleQuery->Execute();
}
catch (EOracleError &OraErr)
{
// this does not execute at all
ShowMessage(OraErr.Message);
}

The problem is that I am unable to process errors coming from oracle (My try..catch block is not working) ie I want to continue processing rows even if I get ORA-00001 (Unique Constraint Violation).

Could anyone help me with this issue ? What is wrong in the code ?
 
The code within the "Catch" block is not executing when I get an exception. The flow stops executing, by just displaying an oracle error message.

It looks like I have to handle the problem in the OnArrayError event. The only way to keep executing the FOR loop is by setting "Continue = true; "
 
Back
Top