Click here to Skip to main content
15,891,942 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi my stored procedure is not working f9 when i use if else loop
in it.plz tell me where mi wrong.the procedure is:


SQL
DELIMITER $$
DROP PROCEDURE IF EXISTS `naukri4u`.`reg`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `reg(_action varchar(50))
BEGIN
    IF _action='insert' THEN
    select * from admin;
    END IF;

    END$$
DELIMITER ;
Posted
Comments
AspDotNetDev 4-Dec-10 4:47am    
What the heck is an "if else loop"? I don't even see an else in the code you posted.
Rajesh Anuhya 4-Dec-10 4:58am    
Post code with else part..,
mylogics 4-Dec-10 5:07am    
yaa i have tried now its executing the else block but its not goin in if block.plz help.

1 solution

Make sure you are passing insert into the _action parameter you have defined.
 
Share this answer
 
Comments
mylogics 4-Dec-10 5:01am    
actually its not taking insert action

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900