Click here to Skip to main content
12,622,913 members (30,334 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# MySQL
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 23-Dec-12 1:11am
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

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.161128.1 | Last Updated 24 Dec 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100