470,614 Members | 1,425 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,614 developers. It's quick & easy.

How to signal a warning inside a trigger ?

I would like to signal a warning from a trigger but what I get it's
always and error instead of a warning. Is it possible to signal a
warning from a trigger ?
.....

SIGNAL SQLSTATE '01ZZZ' ('RICHIESTO UN TEST REPORT');

.....

DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL0723N An error occurred in a triggered SQL statement in trigger
"MAXI.INS_DOCUMENTO". Information returned for the error includes
SQLCODE
"-435", SQLSTATE "428B3" and message tokens "01ZZZ". SQLSTATE=09000

Nov 14 '06 #1
2 2564
Massimiliano Campagnoli wrote:
I would like to signal a warning from a trigger but what I get it's
always and error instead of a warning. Is it possible to signal a
warning from a trigger ?
....

SIGNAL SQLSTATE '01ZZZ' ('RICHIESTO UN TEST REPORT');

....

DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL0723N An error occurred in a triggered SQL statement in trigger
"MAXI.INS_DOCUMENTO". Information returned for the error includes
SQLCODE
"-435", SQLSTATE "428B3" and message tokens "01ZZZ". SQLSTATE=09000
You can't raise warnings in triggers.
Since warnings don't survive the next statement. It kind of makes no
sense from an SQL/PSM point of view.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

WAIUG Conference
http://www.iiug.org/waiug/present/Fo...Forum2006.html
Nov 14 '06 #2

Massimiliano Campagnoli wrote:
I would like to signal a warning from a trigger but what I get it's
always and error instead of a warning. Is it possible to signal a
warning from a trigger ?
You could instead write an external procedure doing your stuff, and
call that from the trigger. I think I have seen a developerworks
article on the subject, but this was all I could find for now:

http://wiki.apache.org/db-derby/SendEmailRoutine
HTH
/Lennart

[...]

Nov 14 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Ahmed Ossman | last post: by
11 posts views Thread by Jackie | last post: by
13 posts views Thread by vashwath | last post: by
8 posts views Thread by hlinzhou | last post: by
7 posts views Thread by Adrian Casey | last post: by
10 posts views Thread by subramanian | last post: by
5 posts views Thread by Yves Dorfsman | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.