Exceptions: Difference between revisions
Content deleted Content added
Line 2,940:
SET result = numerator / denominator;
END IF;
END
@
</lang>
The next example just raise an exception, does not wrap a raised one.
<lang sql pl>
BEGIN
SIGNAL SQLSTATE '75002'
END
@
</lang>
Output:
<pre>
$ db2 -td@
db2 => BEGIN
...
db2 (cont.) => END
db2 (cont.) => @
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
Line 2,971 ⟶ 2,963:
division". SQLSTATE=21543
db2 => BEGIN
db2 (cont.) => SIGNAL SQLSTATE '75001'
db2 (cont.)
db2 (cont.) => END
db2 (cont.) => @
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
|