Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. what's the problem with this?!

what's the problem with this?!

Scheduled Pinned Locked Moved Database
databasehelpannouncementmysqlcom
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jassim Rahma
    wrote on last edited by
    #1

    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

    M L 2 Replies Last reply
    0
    • J Jassim Rahma

      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

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • J Jassim Rahma

        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

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        At a guess it does not like the semi-colons at the end of the statement(s), and/or the extra END; clause. However, in order to be sure you should check the manual.

        Use the best guess

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups