Page 1 of 1

stored procedure error

Posted: Fri Apr 20, 2007 10:21 am
by pleigh
hi, i have a code here and can't make it to work, im very new to stored procedure using mysql and i am not familiar yet

Code: Select all

DELIMITER $$

DROP PROCEDURE IF EXISTS `dorknozzle`.`InsertHelpDesk`$$

CREATE PROCEDURE `dorknozzle`.`InsertHelpDesk`(?EmployeeID int, ?StationNumber int, ?CategoryID int, ?SubjectID int. ?Description varchar, ?StatusID int)
    
    BEGIN
	insert into HelpDesk(EmployeeID, StationNumber, CategoryID, SubjectID, Description, StatusID) 
	values(?EmployeeID, ?StationNumber, ?CategoryID, S?ubjectID, ?Description, ?StatusID)
    END$$

DELIMITER ;
and the error message is
Error Code : 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 '?EmployeeID int, ?StationNumber int, ?CategoryID int, ?SubjectID int. ?Descripti' at line 1
please help. thanks in advance

Posted: Fri Apr 20, 2007 10:22 am
by John Cartwright

Code: Select all

?CategoryID, S?ubjectID, 
Look very very carefully :wink:

Posted: Fri Apr 20, 2007 10:47 am
by pleigh
hi, thanks..did this, still an error

Code: Select all

DELIMITER $$

DROP PROCEDURE IF EXISTS `dorknozzle`.`InsertHelpDesk`$$

CREATE PROCEDURE `dorknozzle`.`InsertHelpDesk`(?EmployeeID int, ?StationNumber int, ?CategoryID int, ?SubjectID int ?Description varchar, ?StatusID int)
    
    BEGIN
	insert into HelpDesk(EmployeeID, StationNumber, CategoryID, SubjectID, Description, StatusID) 
	values(?EmployeeID, ?StationNumber, ?CategoryID, ?SubjectID, ?Description, ?StatusID)
    END$$

DELIMITER ;

Posted: Fri Apr 20, 2007 10:50 am
by pleigh
i also did this

Code: Select all

DELIMITER $$

DROP PROCEDURE IF EXISTS `dorknozzle`.`InsertHelpDesk`$$

CREATE PROCEDURE `dorknozzle`.`InsertHelpDesk`(eid int, stn int, cid int, subid int, des varchar(50), statid int)
    
    BEGIN
	insert into HelpDesk(EmployeeID, StationNumber, CategoryID, SubjectID, Description, StatusID) 
	values(eid, stn, cid, subid, des, statid)
    END$$

DELIMITER ;
error is
Error Code : 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 'insert into HelpDesk(EmployeeID, StationNumber, CategoryID, SubjectID, Descripti' at line 4