Syntax Question for an Exception
Hi Everyone,
I'm writing a procedure that deletes a SINGLE row in a table based on two column data values given as parameters for that procedure (these two columns have a combined unique constraint).
It works, but I'm stuck on this: This procedure should raise an exception if the combination of these two parameter values doesn't exist in the table, thereby rejecting the delete with an error message.
Basically, how do I check in the IF / END IF block for the exception to be raised, whether the combination of two values in any data row already exists?
I can only think of doing a select for these two values in the IF / END IF block for the exception check, but the procedure seems to reject 'SELECT' in this context.
Help would be greatly appreciated.
Thanks
Peer