SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot dizyn's Avatar
    Join Date
    Apr 2006
    Posts
    181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    stored PROCEDURE problem

    Here is my sql statement:

    Code MySQL:
    DROP PROCEDURE IF EXISTS `check_user`;
     
    CREATE PROCEDURE `check_user`(IN userid VARCHAR(25))
        NOT DETERMINISTIC
        SQL SECURITY DEFINER
        COMMENT ''
    BEGIN
           select loginid from user where loginid=userid;
    END;


    I am using:

    # Server version: 5.0.41-community-nt
    # Protocol version: 10
    # Server: localhost via TCP/IP
    # User: root@localhost
    # phpmyadmin

    when i try to run above mentioned statement I get following error:

    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select loginid from user where loginid=userid' at line 6

    any help?

    thanks

  2. #2
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    are you changing your delimiter before pasting in that code?

  3. #3
    SitePoint Zealot dizyn's Avatar
    Join Date
    Apr 2006
    Posts
    181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by longneck View Post
    are you changing your delimiter before pasting in that code?
    how to change it?

    thanks
    dizyn

  4. #4
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Code mysql:
    DELIMITER $
     
    DROP PROCEDURE IF EXISTS `check_user`;
     
    CREATE PROCEDURE `check_user`(IN userid VARCHAR(25))
        NOT DETERMINISTIC
        SQL SECURITY DEFINER
        COMMENT ''
    BEGIN
           SELECT loginid FROM user WHERE loginid=userid;
    END;
     
    DELIMITER ;


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •