Can trigger procedures return value

Started by Deepa Kover 22 years ago2 messagesgeneral
Jump to latest
#1Deepa K
kdeepa@midascomm.com

Hi all,
Can trigger procedures can return
values.

Actually I need a trigger that should
not allow rows to be updated in a particular
table on a specific condition.(like users
other than 'manager' should not be allowed to
update that table')

If the user other than 'manager' tries to update
that table, I need a error number that should be
returned by trigger procedure to prompt the
user that he/she is not a valid user.

If it is not possible to return error from
trigger procedure, what could be the possible
way to solve the above problem.

regards,
Deepa. K

#2nolan
nolan@celery.tssi.com
In reply to: Deepa K (#1)
Re: Can trigger procedures return value

If it is not possible to return error from
trigger procedure, what could be the possible
way to solve the above problem.

What you want is 'raise exception', which allows you to return an
error message explaining things.

Use something like "RAISE EXCEPTION ''You are not authorized to
update this information'';"
--
Mike Nolan