When iam executing a mysql procedure through vb.net during execute non query getting exception as" ERROR [42000] [MySQL][ODBC 5.1 Driver][mysqld-5.1.39-community]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 ‘procedure_name’ at line 1.May i know the reason?
Your procedure has an incorrect syntax.
If you post the sql code here, we can take a look.
DELIMITER $$
DROP PROCEDURE IF EXISTS SP_InsertSVMHBEntry
$$
CREATE DEFINER=root
@%
PROCEDURE SP_InsertSVMHBEntry
(IN _strId numeric,IN _mrrId numeric,IN _hbType numeric,IN _hbDate datetime,IN _hbTime time,IN _sysStartTime datetime)
BEGIN
Declare _receivedTime datetime;
Declare _availability int;
Declare _Sno numeric;
select NOW() into _receivedTime;
select max(Sno)+1 into _Sno from SvmHB;
if _Sno is Null then
set _Sno=1;
end if;
insert into SVMHB(Sno,StoreId,MirrorId,HBType,HBDate,HBTime,SystemStartupTime,ReceivedDateTime)
values(_Sno,_strId,_mrrId,_hbType,_hbDate,_hbTime,_sysStartTime,_receivedTime);
select count(*) into _availability from SVMALERTHB where StoreId = _Strid and Mirrorid = _Mrrid;
if _availability != 0 then
delete from SVMALERTHB where StoreId = _Strid and Mirrorid = _Mrrid;
end if;
END $$
DELIMITER ;