trigger to prevent insert
Posted in 2009
We have a program that was written in C++ and we do not have the code for it and cannot even trace the programmer so I know that this change would have been nice to have been done in the program but right now we cannot do it. We need to do some validation while we insert records on a table let say table A. If customer_code that the user is trying to insert in table A already exists in table B then prevent the data from being written. The good thing is that the program throws a generic error for unknow errors and does not crash, but we really do not care about user feedback in this case. Can a trigger be used to do this? If so how? Or anything else we could do in the database side to prevent this from happening? Thank you, Genti