stored procedure error

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
pleigh
Forum Contributor
Posts: 445
Joined: Wed Jan 19, 2005 4:26 am

stored procedure error

Post 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
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Code: Select all

?CategoryID, S?ubjectID, 
Look very very carefully :wink:
User avatar
pleigh
Forum Contributor
Posts: 445
Joined: Wed Jan 19, 2005 4:26 am

Post 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 ;
User avatar
pleigh
Forum Contributor
Posts: 445
Joined: Wed Jan 19, 2005 4:26 am

Post 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
Post Reply