Click here to Skip to main content
15,891,745 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi all,

I am trying to use Stored Procedure to do an Update function to my table records, but apparently, my script doesn't seem to work. In which, I suspect that the SET command used is in Update function and the SET command used in Stored Procedure sort of 'clashes'. Correct me if I am wrong.

Please advice on how to get the Update function done in Stored Procedure.

Here's my version of Stored Procedure:
CREATE PROCEDURE mysql_biosys.edit_Site(site_Id_Parsed INT, site_Name_Entered VARCHAR(64), address_Entered VARCHAR(64), postal_code_Entered INT,
commence_Date_Entered VARCHAR(16), completion_Date_Entered VARCHAR(16))
BEGIN
UPDATE site
SET site_Name = site_Name_Entered,
address = address_Entered,
postal_Code = postal_code_Entered,
commence_Date = commence_Date_Entered,
completion_Date = completion_Date_Entered
WHERE site_Id = site_Id_Parsed;
END;
|

Thanks in advance.
Posted
Comments
OriginalGriff 23-Dec-12 6:26am    
"doesn't seem to work" is not a very precise description of your problem.
What does it do that it shouldn't, or not do that it should?
Jibesh 23-Dec-12 14:08pm    
what error you are getting when running the SP? nothing getting updated? did you check there exists a vaid site_Id in the site table and the site_Id_Parsed is a valid one too??

1 solution

We should specify the type of parameter(In,Out,InOut) passing to stored procedure.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900