what's the problem with this?!
-
I have the following stored procedure on MySQL. It's running perfectly the MySQL on my laptop but when I try to create it on my host server I am getting: You have an error in your SQL syntax. check the manual that corresponds to yout mySQL server version for the right syntax to use near 'param_limit; END; ELSE BEGIN SELECT event_log.event_log_date_time, even' at line 5 this is the stored procedure:
IF (param\_limit IS NOT NULL) THEN BEGIN SELECT event\_log.event\_log\_date\_time, event\_log.event\_log\_title FROM event\_log WHERE event\_log.event\_log\_member\_id = param\_member\_id ORDER BY event\_log.event\_log\_date\_time DESC LIMIT param\_limit; END; ELSE BEGIN SELECT event\_log.event\_log\_date\_time, event\_log.event\_log\_title FROM event\_log WHERE event\_log.event\_log\_member\_id = param\_member\_id ORDER BY event\_log.event\_log\_date\_time DESC; END; END IF;
Technology News @ www.JassimRahma.com
-
I have the following stored procedure on MySQL. It's running perfectly the MySQL on my laptop but when I try to create it on my host server I am getting: You have an error in your SQL syntax. check the manual that corresponds to yout mySQL server version for the right syntax to use near 'param_limit; END; ELSE BEGIN SELECT event_log.event_log_date_time, even' at line 5 this is the stored procedure:
IF (param\_limit IS NOT NULL) THEN BEGIN SELECT event\_log.event\_log\_date\_time, event\_log.event\_log\_title FROM event\_log WHERE event\_log.event\_log\_member\_id = param\_member\_id ORDER BY event\_log.event\_log\_date\_time DESC LIMIT param\_limit; END; ELSE BEGIN SELECT event\_log.event\_log\_date\_time, event\_log.event\_log\_title FROM event\_log WHERE event\_log.event\_log\_member\_id = param\_member\_id ORDER BY event\_log.event\_log\_date\_time DESC; END; END IF;
Technology News @ www.JassimRahma.com
Caveat: I have absolutely no knowledge of MySQL, but the error message tells you precisely what you should do.
Jassim Rahma wrote:
check the manual that corresponds to yout mySQL server version for the right syntax to use near 'param_limit; END;
I suspect they changed the syntax and you have an additional ; in your query.
Never underestimate the power of human stupidity RAH
-
I have the following stored procedure on MySQL. It's running perfectly the MySQL on my laptop but when I try to create it on my host server I am getting: You have an error in your SQL syntax. check the manual that corresponds to yout mySQL server version for the right syntax to use near 'param_limit; END; ELSE BEGIN SELECT event_log.event_log_date_time, even' at line 5 this is the stored procedure:
IF (param\_limit IS NOT NULL) THEN BEGIN SELECT event\_log.event\_log\_date\_time, event\_log.event\_log\_title FROM event\_log WHERE event\_log.event\_log\_member\_id = param\_member\_id ORDER BY event\_log.event\_log\_date\_time DESC LIMIT param\_limit; END; ELSE BEGIN SELECT event\_log.event\_log\_date\_time, event\_log.event\_log\_title FROM event\_log WHERE event\_log.event\_log\_member\_id = param\_member\_id ORDER BY event\_log.event\_log\_date\_time DESC; END; END IF;
Technology News @ www.JassimRahma.com