Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
DELIMITER $$

DROP PROCEDURE IF EXISTS `flip_linkutilisation`.`GetAllInterfaces` $$
CREATE PROCEDURE `flip_linkutilisation`.`GetAllInterfaces`
(
  flag VARCHAR(20)
)

BEGIN
  IF(flag='Link') THEN
    SELECT * FROM categorisedinterfaces WHERE LinkType <> 0;

  ELSE

  IF(flag='Server') THEN
    SELECT * FROM categorisedinterfaces WHERE LinkType = 0;

   END IF
   ;
END $$

DELIMITER ;




The above procedure is showing syntax error..

Please guide me where I made mistake.

Thanks in advance
Posted

1 solution

An error occurs because of IF...END IF block.

Have a look here: MySQL: IF statement[^] and try to find error.
 
Share this answer
 
Comments
CPallini 5-Dec-13 5:00am    
5.
Maciej Los 5-Dec-13 5:01am    
Thank you, Carlo ;)

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