Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
16
Task/Exceptions/SQL-PL/exceptions-1.sql
Normal file
16
Task/Exceptions/SQL-PL/exceptions-1.sql
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
--#SET TERMINATOR @
|
||||
|
||||
BEGIN
|
||||
DECLARE numerator INTEGER DEFAULT 12;
|
||||
DECLARE denominator INTEGER DEFAULT 0;
|
||||
DECLARE result INTEGER;
|
||||
DECLARE overflow CONDITION for SQLSTATE '22003' ;
|
||||
DECLARE CONTINUE HANDLER FOR overflow
|
||||
RESIGNAL SQLSTATE '22375'
|
||||
SET MESSAGE_TEXT = 'Zero division';
|
||||
IF denominator = 0 THEN
|
||||
SIGNAL overflow;
|
||||
ELSE
|
||||
SET result = numerator / denominator;
|
||||
END IF;
|
||||
END @
|
||||
Loading…
Add table
Add a link
Reference in a new issue