SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Oct 2009
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Stored Procedure

    I am receiving an error (error code) on a stored procedure. It's frekin me out as its working on one place but giving error on the other. The sequence that I will follow explaining my problem below will consist of Version, Error code and description, Error code received string and No error code string.... Hope this gives a clear explanation of the problem that I am facing...hoping for swift reply Thanks, SJ

    ----------------------------------------------------------------------------------

    MYSQL VERSIONS

    Mysql Administrator interface 1.2.15
    Mysql Server 5.1.30 community via TCP/IP
    Mysql client version 5.1.11
    Navcat lite 8.2.13
    ----------------------------------------------------------------------------------

    ERROR CODE AND DESCRIPTION

    ERROR CODE: 1064
    ERROR DESCRIPTION: Script line: 4 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 'END' at line 4


    ----------------------------------------------------------------------------------

    ERROR RECEIVED

    DELIMITER $$

    DROP PROCEDURE IF EXISTS `familytree`.`UserInfo_insert` $$
    CREATE DEFINER=`root`@`localhost` PROCEDURE `UserInfo_insert`( IN UserLogin VARCHAR(50),UserPassword Varchar(50),UserEmailId varchar(50),UserFirstName varchar(50),UserLastName varchar(50),UserFatherName varchar(50),UserMotherName varchar(50))
    BEGIN
    insert into UserInfo(UserId,Password,EmailId,FirstName,LastName,FatherName,MotherName) values (UserLogin,UserPassword,UserEmailId,UserFirstName,UserLastName,UserFatherName,UserMotherName)
    END $$

    DELIMITER ;
    ----------------------------------------------------

    NO ERROR RECEIVED

    DELIMITER $$

    DROP PROCEDURE IF EXISTS `familytree`.`UserInfo_get` $$
    CREATE DEFINER=`root`@`localhost` PROCEDURE `UserInfo_get`( IN UserLogin VARCHAR(50),UserPassword Varchar(50))
    BEGIN
    select concat(firstname,' ',lastname) as name from userinfo where userid=UserLogin and Password=UserPassword;
    END $$
    DELIMITER ;

    ----------------------------------------------------------------------------------

  2. #2
    SitePoint Guru
    Join Date
    Jan 2004
    Location
    Uppsala, sverige
    Posts
    698
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    You are missing a ; after the insert statement.


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
  •