MySQL Forums
Forum List  »  Stored Procedures

Re: Capture error messages using DECLARE statements
Posted by: Roland Bouman
Date: February 13, 2006 03:16AM

Hi!

(BTW: did you add a comment to the bug report? It might help if the developers see the item is actively viewed and edited. Thank you.)

I don't really understand your comment: I thought that procedure nesting was fixed. Conditions that arise in the procedures should be propagated to the caller...

in fact, this quick test demonstrates that it works for me:

mysql> select * from detail;
+----+-------------+
| id | name |
+----+-------------+
| 0 | the default |
| 2 | the default |
+----+-------------+
2 rows in set (0.07 sec)

mysql> delimiter //
mysql> create procedure p_fail()
-> begin
-> declare v_id int;
-> select id into v_id from detail;
-> end;
-> //
Query OK, 0 rows affected (0.16 sec)

mysql> call p_fail()
-> //
ERROR 1172 (42000): Result consisted of more than one row
mysql> create procedure p_call_fail()
-> begin
-> call p_fail();
-> end;
-> //
Query OK, 0 rows affected (0.00 sec)

mysql> call p_call_fail()
-> ;
-> //
ERROR 1172 (42000): Result consisted of more than one row
mysql> select version();
-> //
+-----------+
| version() |
+-----------+
| 5.0.17-nt |
+-----------+
1 row in set (0.02 sec)

mysql>

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.