MySQL Forums
Forum List  »  Stored Procedures

stored procedure not working
Posted by: Matt Dinatale
Date: October 23, 2005 04:04PM

Im new to stored procedures and i don't know why this doesn't work

CREATE PROCEDURE `sp_clk4`(id INT)
BEGIN
DECLARE nc INT;
Select numclk INTO nc from videos where vid = id;
SET nc = nc + 1;
UPDATE Videos SET numclk = nc where vid = id;
END


I want to take the result from on select statment and add one to it then use it to update the table. Thanks for your help

Matt

Options: ReplyQuote


Subject
Views
Written By
Posted
stored procedure not working
2799
October 23, 2005 04:04PM
1808
October 24, 2005 12:24AM
1868
October 24, 2005 01:34AM
1724
October 24, 2005 04:29AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.