MySQL Forums
Forum List  »  MySQL Query Browser

Print in MySQL Query Browser ?
Posted by: Ricardo Bravo
Date: July 11, 2010 12:01PM

Hello, since I can stamp in a cursor...
I use the command print variable
The variable, it stores information of a consultation..

With the command print, it generates the mistake 1064...

Here this my code .. it wanted to know if they can help me, since I am new in the MySQL

DELIMITER //
CREATE PROCEDURE CANT_comp(IN ZONA VARCHAR(30))
BEGIN
DECLARE DONE BOOLEAN DEFAULT FALSE;
DECLARE cant INT;
DECLARE C1 CURSOR
FOR
select count(*) from cliente c inner join zona z on z.idzona=c.idzona
inner join venta v on v.idcliente=c.idcliente
where z.descripcion = @zona
group by c.idcliente
order by count(v.idcliente)desc
limit 1;

DECLARE CONTINUE HANDLER FOR SQLSTATE '02000'
SET DONE=TRUE;
open C1;
REPEAT
FETCH C1 INTO CANT;
IF NOT done THEN
print cant;
END IF;
UNTIL DONE END REPEAT;
close C1;

END
//


Thank you, in advance
Regards...

Options: ReplyQuote


Subject
Written By
Posted
Print in MySQL Query Browser ?
July 11, 2010 12:01PM


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.