locked
What is wrong in that RRS feed

  • Question

  • User322534949 posted
    CREATE PROCEDURE 'DL05sp' (IN timval datetime,IN resis float,IN BarCode1 varchar(150),IN BarCode2 varchar(150))
    BEGIN INSERT INTO dl05 (TimeValue, Resistance, BarCode_1, BarCode_2) values (timeval,resis,BarCode1,BarCode2); END
    
    
    
    ERROR 1064 (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 'END
    CREATE PROCEDURE 'DL05sp' (IN timval datetime,IN resis float,IN BarCode1 var' at
     line 1

    The only thing is im trying to execute in mysql command line

    Please help me

    Thanks

    Friday, December 12, 2014 12:54 AM

All replies

  • User-515898492 posted

    Hi,

    Please try below procedure.

    DELIMITER $$
    CREATE PROCEDURE 'DL05sp' (IN timval datetime,IN resis float,IN BarCode1 varchar(150),IN BarCode2 varchar(150))
    
    BEGIN
     INSERT INTO dl05 (TimeValue, Resistance, BarCode_1, BarCode_2) values (timeval,resis,BarCode1,BarCode2); 
    END$$
    

     

     

    Friday, December 12, 2014 1:09 AM
  • User322534949 posted

    DELIMITER $$
    CREATE PROCEDURE 'DL05sp' (IN timval datetime,IN resis float,IN BarCode1 varchar(150),IN BarCode2 varchar(150))
    
    BEGIN
     INSERT INTO dl05 (TimeValue, Resistance, BarCode_1, BarCode_2) values (timeval,resis,BarCode1,BarCode2); 
    END$$

    Still the same error bro :(

    Friday, December 12, 2014 1:16 AM
  • User-515898492 posted

    Hi,

    Sorry

    add  DELIMITER ; at the end of the procedure.

    Note: you can use either $$ or //

    Friday, December 12, 2014 1:44 AM
  • User269602965 posted

    CREATE PROCEDURE 'DL05sp'

    remove quotes around procedure name

    CREATE PROCEDURE DL05sp

    Friday, December 12, 2014 1:58 PM
  • User-271186128 posted

    Hi AshwinKiran,

    As Lannie said, please try to remove quotes around procedure name. Here are some article about MySQL Stored procedure Tutorial, you could refer to them.

    http://forums.mysql.com/read.php?98,358569

    http://dev.mysql.com/doc/connector-net/en/connector-net-tutorials-stored-procedures.html

    Best Regards,
    Dillion

    Thursday, January 15, 2015 5:06 AM