Обсуждение: Problems with RAISE EXCEPTION

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

Problems with RAISE EXCEPTION

От
Tulio Oliveira
Дата:
Hi,

My triggers performs a lot of verifications over the data before insert
or update.

So I need make all checks, and at the end, RAISE EXCEPTION msgsErrors;

and the variable msgsErrors containing all Error Messages reported by
hole trigger.

But the RAISE EXCEPTION don't accept variables, only a CONTANT STRING.

Nor strigs concatenation are supported ........


I'm make any mistake ?
Exist any way to do that ?



Regards,

Tulio Oliveira


Re: Problems with RAISE EXCEPTION

От
brichard@cafod.org.uk (Bruce Richardson)
Дата:
On Tue, Feb 27, 2001 at 08:40:27AM -0300, Tulio Oliveira wrote:
> But the RAISE EXCEPTION don't accept variables, only a CONTANT STRING.
>
> Nor strigs concatenation are supported ........

You can add variables to the string, like this:

RAISE EXCEPTION "Record % has same name as record %", new.name,
other.name;

--
Bruce