I’m trying to create this procedure
CREATE PROCEDURE RequestApproval (
IN occupation enum('professor', 'student', 'pastor'),
IN organization varchar(500),
IN lastName varchar(100),
IN firstName varchar(100),
IN email varchar(300),
IN phone varchar(50),
IN description varchar(10000)
)
BEGIN
INSERT INTO `Discounts`(`Occupation`,
`Organization`,
`LastName`,
`FirstName`,
`Email`,
`Phone`,
`Description`)
VALUES (occupation,
organization,
lastName,
firstName,
email,
phone,
description);
END ;
and I’m getting this error
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 ” at line 24
I don’t know what to change when it just says that there is invalid syntax near the empty string (''). It won’t tell me what the invalid token is–what am I doing wrong?
Looks like you need to set an alternate delimiter. The following will work with the MySQL command line client using the
DELIMITERkeyword, but other clients have their own methods of specifying a delimiter.It reports a syntax error on line 11 with no specific character, probably because it has interpreted the
;on that line as the final delimiter ending the procedure (which is invalid without a closingEND).