0

There is an a problem on declaring variables on MYSQL stored procedure.The code I used I used is shown below.

DELIMITER $$

CREATE
    /*[DEFINER = { user | CURRENT_USER }]*/
    PROCEDURE `emp`.`third_SP`()
    /*LANGUAGE SQL
    | [NOT] DETERMINISTIC
    | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }
    | SQL SECURITY { DEFINER | INVOKER }
    | COMMENT 'string'*/
    BEGIN
DECLARE p1 int ;



   SELECT Min(esal)
   INTO pl
   FROM employ;
 



    END$$


DELIMITER ;

It shows the error message as
----------------------------------
error code :1327
undeclared variable p1
----------------------------------
I am using MySQL 5.1.4.1..Using SQLYOG Enterprise Trial 7. 11 as GUI.Anyone plz help me.

Thanks

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by hielo
0

If your editor supports different fonts, then change your font-family to Verdana.

Otherwise copy and paste your code onto a text editor (like MS Word); highlight it all then change the font-family to Verdana.

Do you see the now that p1 (p followed by number one) is NOT the same as pl (p followed by lowercase "L")!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.