I've searched through the documentation only to find very brief examples of java triggers which makes coding your own very hard with limited Java exposure.
Can anyone point me to documentation that I might have missed or possibly post some samples for Parent Delete Restrict ie. if the record I want to delete exists as a foreign key in a child table then don't perform the deletion.
Thanks,
Dave
Shuttleworth Business Systems
Development
It's small snippets of knowledge like THIS that really should be on the first page of the Java Trigger documentation.
I've now managed to create some simple trigger code instead of figuring out why the simplest of Java Triggers don't compile.
This is what I ended up with after reading through all of the the stored procedure and triggers documentation.
Looks like you are checking to see if a row exists when doing an insert. Presumably most of the time the row will not exist so you have all this overhead that usually doesn't find anything on every insert. Why don't you just let the insert fail and detect the error if there is a duplicate?