SQL Server Performance

Help!!!

Discussion in 'Getting Started' started by alex_pierce, Mar 4, 2010.

  1. alex_pierce New Member

    Hi there!
    I'm fairly new to MySQL and have been given the task to 'create procedures' I've done this exactly the way i think i should but keep getting an error referring to my syntax;
    17:05:02 [CREATE - 0 row(s), 0.000 secs] [Error Code: 1064, SQL State: 42000] 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 'sp_email_create'
    (
    IN temp_accountid CHAR(35)
    IN temp_email VARCHAR(140)
    )
    BEGIN
    INS' at line 1
    ... 1 statement(s) executed, 0 row(s) affected, exec/fetch time: 0.000/0.000 sec [0 successful, 0 warnings, 1 errors]

    This is what I have written;
    CREATE PROCEDURE 'MailingList''sp_email_create'
    (
    IN temp_accountid CHAR(35)
    IN temp_email VARCHAR(140)
    )
    BEGIN
    INSERT INTO tbl_emails(accountid, email)
    VALUES (temp_accountid,temp_email)
    END
    Please help...baffled to hell!
  2. FrankKalis Moderator

    Welcome to the forum!
    This forum is dedicated to Microsoft SQL Server. [:)]
    Does this work for you in MySQL?
    DELIMITER $$
    DROP PROCEDURE IF EXISTS `MailingList`.`sp_email_create` $$
    CREATE PROCEDURE `MailingList``sp_email_create`
    (
    temp_accountid CHAR(35),
    temp_email VARCHAR(140)
    )

    INSERT INTO tbl_emails(accountid, email)
    VALUES (temp_accountid,temp_email) $$

    DELIMITER ;
  3. alex_pierce New Member

    Hi!
    As soon as i clicked send i realised that this was MS dedicated, but anyways thanks for your help, i gave it a go and it came up with a similar error as before, to be honest much more helpful than the guys on the MySQL forum!!
    Many Thanks
    Alex
  4. Madhivanan Moderator

    See what happens when you try this?
    DELIMITER $$;
    DROP PROCEDURE IF EXISTS `mysql`.`sp_email_create`$$
    CREATE PROCEDURE `mysql`.`sp_email_create` (
    temp_accountid CHAR(35),
    temp_email VARCHAR(140)
    )
    BEGIN
    INSERT INTO tbl_emails(accountid, email)
    VALUES (temp_accountid,temp_email);
    END$$
    DELIMITER ;$$

Share This Page