Carl A
10-06-2007, 03:04 PM
Cross Posted Here with no replies.
http://forums.mysql.com/read.php?108,174714,174714#msg-174714
I'm just starting out with MySQL and have an issue with the Query Browser. I have created a simple stored procedure.
DELIMITER $$
DROP PROCEDURE IF EXISTS `crashcourse`.`ordertotal` $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `ordertotal`(
IN onumber INT,
OUT ototal DECIMAL(8,2)
)
BEGIN
SELECT Sum(item_price*quantity)
FROM orderitems
WHERE order_num = onumber
INTO ototal;
END $$
DELIMITER ; From the Command line I Call the procedure and assign a variable to the results.
mysql> CALL ordertotal(20005, @total);
Query OK, 0 rows affected (0.00 sec)
mysql> SELECT @total;
+--------+
| @total |
+--------+
| 149.87 |
+--------+
1 row in set (0.00 sec)
mysql>
However when I call the procedure in the Query Browser the resultset returns null.
Is there something I'm missing or doing wrong? :confused2
Query Browser Version is 1.2.12
MySQL Version is 5.0.45
OS is Vista Business and XP
http://forums.mysql.com/read.php?108,174714,174714#msg-174714
I'm just starting out with MySQL and have an issue with the Query Browser. I have created a simple stored procedure.
DELIMITER $$
DROP PROCEDURE IF EXISTS `crashcourse`.`ordertotal` $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `ordertotal`(
IN onumber INT,
OUT ototal DECIMAL(8,2)
)
BEGIN
SELECT Sum(item_price*quantity)
FROM orderitems
WHERE order_num = onumber
INTO ototal;
END $$
DELIMITER ; From the Command line I Call the procedure and assign a variable to the results.
mysql> CALL ordertotal(20005, @total);
Query OK, 0 rows affected (0.00 sec)
mysql> SELECT @total;
+--------+
| @total |
+--------+
| 149.87 |
+--------+
1 row in set (0.00 sec)
mysql>
However when I call the procedure in the Query Browser the resultset returns null.
Is there something I'm missing or doing wrong? :confused2
Query Browser Version is 1.2.12
MySQL Version is 5.0.45
OS is Vista Business and XP