Problems with RAISE EXCEPTION

Started by Tulio Oliveiraabout 25 years ago2 messagesgeneral
Jump to latest
#1Tulio Oliveira
mestredosmagos@marilia.com

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

#2Noname
brichard@cafod.org.uk
In reply to: Tulio Oliveira (#1)
Re: Problems with RAISE EXCEPTION

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