Обсуждение: Can trigger procedures return value

Поиск
Список
Период
Сортировка

Can trigger procedures return value

От
Deepa K
Дата:
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


Re: Can trigger procedures return value

От
nolan@celery.tssi.com
Дата:
>  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