--Try the attachment
Main Topics
Browse All TopicsI am getting an error when I try to execute this stored procedure; I can't figure out why as the syntax looks OK to me.
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 '(1, 41083, 1, 1)' at line 1
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Its working as expected here at my end.. which MySQL version you have? how are you calling stored procedure?
delimiter //
create procedure link_po_detach
(IN pCompany int
, pPONum int
, pPOLineNum int
, pPODistNum int)
begin
delete from campaign_po
where Company = pCompany
and PONum = pPONum
and POLineNum = pPOLineNum
and PODistNum = pPODistNum
;
end//
delimiter ;
call link_po_detach(1,2,1,1);
Found the problem (actually two problems)
(1) I was initially calling from Access and neglected to set the procedure name (.CommandText) correctly - forgot the double quotes, so Access thought I was using an undefined string variable, d'uh
(2) When I went to test the proc in query browser I was calling it using EXECUTE and not CALL.
Addressing both those fixed the problem and I'm up and running.
Awarding points to ushastry, whose challenges led me to figure this out (and who told me to use CALL...). Responses to all are below.
Chandan: thanks, but that wouldn't even execute. MySQL liked neither the 'AS' nor the @ before parameters.
ushastry: thanks, I'm running 5.1 I'm using an Access front end but the procedure won't run even from query browser.
profya: thanks, the error is in the question body: 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 '(1, 41083, 1, 1)' at line 1
Stored procedures are supported, I'm using others in the same db.
Business Accounts
Answer for Membership
by: johnclarke123Posted on 2009-11-04 at 01:01:11ID: 25737521
I've just spotted and fixed the error at line 11 (second POLineNum should be the parameter name pPOLineNum). But I'm still getting the same error.