OracleQuery Partial Updates and Exceptions

d4jaj1

Member²
Hello,

I'm using an OracleQuery in an Midas app to Update records with a standard SQL string at runtime:

sql.add('UPDATE DTAESYS.EXAMS SET PAID = ''Y'', PAID_DATE = TO_DATE(' + DATETOSTR(DATE) + ', ''MM/DD/YYYY'') WHERE INVOICE_NUMBER= ' + FLOATTOSTR(DELTADS.FieldByName('INVOICE_NUMBER').newValue));

If there are 4 records to be updated and the update of the 3rd one fails, does OrarcyQuery generate an exception for partial updates after execute? I know I can use RowsProcessed to get the number of rows updated; however, I won't know at runtime how many records were supposed to be updated to compare it with.

Thanks.
 
If a single update statement fails on the 3rd record of 4, you will get an EOracleError exception and RowsProcessed will be 0. The first 2 updated records will be rolled back to an internal savepoint by the Oracle Server.

------------------
Marco Kalter
Allround Automations
 
Back
Top