Re: [GENERAL] Using the database to validate data

2015-07-27 Thread JPLapham
Zdeněk Bělehrádek wrote > What about creating a SAVEPOINT before each INSERT, and if the INSERT > returns > an error, then ROLLBACK TO SAVEPOINT? This way you will have all the > insertable data in your table, and you can still ROLLBACK the whole > transaction, or COMMIT it if there were no erro

Re: [GENERAL] Using the database to validate data

2015-07-27 Thread JPLapham
林士博 wrote > If I am following correctly, you can do it in your application as follows. > 1.begin transaction > 2.insert each data. Catch db exception, > and save exception message and other information you need to array. > 3.in the end ,you can get all the information about the wrong data in > arra

Re: [GENERAL] Using the database to validate data

2015-07-25 Thread JPLapham
Tim Clarke wrote > Shouldn't be too difficult to import those new rows into one table, > write a procedure that inserts them into the real table one by one and > logs the validation failure if any - committing good rows and rolling > back bad. In fact if you could then write the failures to a third

[GENERAL] Using the database to validate data

2015-07-23 Thread JPLapham
Hello, I have an application that occasionally performs large batch inserts of user hand-generated data. Input is a tab delimited file with typically hundreds to a thousand lines of data. Because the data is generated by hand, there are always many transaction-stopping errors in a typical input r