TRY MESSAGEBOX('Attempt') INSERT INTO Temp (Numero,NoProvince) VALUES (1,1) MESSAGEBOX('Executed') CATCH MESSAGEBOX('Failed') ENDTRYOn the first run, it inserted the record. On the other run, it failed. All is working ok. I'll try that in the application.