Code: Select all
drop procedure if exists spMensaje;;
create procedure spMensaje(
Numero varchar(10),
Msg varchar(50)
)
begin
select Cast(Numero as signed) as n, concat(msg,': 1') as m; -- >First result set
select cast(Numero as signed)+1 as n, concat(msg,': 2') as m; -- >Second result set
end;;
Code: Select all
call spMensaje ('1000','Hi this is te message');
but I need this two results
if I run this with a myquery or mystoredprocedure or mytable I get "commands out of sync, you cannot run this command now"
if I run the same in the mysql console we will have
Code: Select all
Enter password: ****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.0.37-community-nt MySQL Community Edition (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> use sistema
Database changed
mysql> call spMensaje ('1000','Hi this is te message');
+------+--------------------------+
| n | m |
+------+--------------------------+
| 1000 | Hi this is te message: 1 |
+------+--------------------------+
1 row in set (0.00 sec)
+------+--------------------------+
| n | m |
+------+--------------------------+
| 1001 | Hi this is te message: 2 |
+------+--------------------------+
1 row in set (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
mysql>
so which component shall I use to do this
I appreciate your prompt response