From: Paul Lutus Date: 2006-09-28T04:35:11+09:00 Subject: Re: Commit when error Jose Montero wrote: / ... > Well yes, i have detected when an error comes up. Sometimes its cause > the line contains malformed UTF-8 caracter, in other cases the length is > longer than the size of the field in the database,etc...And im > controlling all this cases, Actually, you are controlling all the cases you are controlling, and the error comes up because of those cases you aren't controlling. > but what i want to do is that if appear an > unknown error, ok, dont process that line, continue and commit the rest > of already loaded lines. And what im trying to figure out is exactly > what u say: what is the state error the database is in, after the failed > query? How could i know this? IMHO, you need to create a bulletproof syntax check that filters out bad records before they are submitted to the database. The proof will be the periodic errors you are seeing will stop. One approach is to create a small test query, using a table that is identical in design to the main table, but with a single record. Submit the records to this table, and if they pass, then submit them to the main database. This way, you have detected any errors before they are committed to the main database. If the small-table test fails, you can still commit the prior records in the mainstream activity and then deal with the error at your leisure. The problem with this approach is it takes twice as long to read records (two queries per record). But any robust error-detection algorithm might also do that. -- Paul Lutus http://www.arachnoid.com