Procedure error: 'chceckVote' in 'field list'

This is a discussion on Procedure error: 'chceckVote' in 'field list' within the MySQL Database forums, part of the Database Forums category; CREATE PROCEDURE addVoteAll (profil_Id int ( 11 ) , commmen_Id int ( 11 ) , grande_ smallint ( 1 )) NOT DETERMINISTIC CONTAINS SQL SQL SECURITY DEFINER COMMENT '' ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-23-2007
lukasz_sabat@o2.pl
 
Posts: n/a
Default Procedure error: 'chceckVote' in 'field list'

CREATE PROCEDURE addVoteAll (profil_Id int ( 11 ) , commmen_Id int
( 11 ) ,
grande_ smallint ( 1 ))
NOT DETERMINISTIC
CONTAINS SQL
SQL SECURITY DEFINER
COMMENT ''
BEGIN
DECLARE checkVote smallint(2) DEFAULT 0;
SET @checkVote = (select count(*) from vote
where profilId=3 and
commentId=3);
IF chceckVote=0 then
INSERT INTO vote (voteId,profilId,commentId,grande) VALUES
(null,profil_Id,commmen_Id, grande_);
END IF;
commit;
END;

Unknown column 'chceckVote' in 'field list'

whats wrong?

Reply With Quote
  #2 (permalink)  
Old 04-23-2007
Lee Peedin
 
Posts: n/a
Default Re: Procedure error: 'chceckVote' in 'field list'

On 23 Apr 2007 01:29:03 -0700, lukasz_sabat@o2.pl wrote:

>CREATE PROCEDURE addVoteAll (profil_Id int ( 11 ) , commmen_Id int
>( 11 ) ,
>grande_ smallint ( 1 ))
> NOT DETERMINISTIC
> CONTAINS SQL
> SQL SECURITY DEFINER
> COMMENT ''
>BEGIN
>DECLARE checkVote smallint(2) DEFAULT 0;
> SET @checkVote = (select count(*) from vote
> where profilId=3 and
>commentId=3);
>IF chceckVote=0 then
>INSERT INTO vote (voteId,profilId,commentId,grande) VALUES
>(null,profil_Id,commmen_Id, grande_);
>END IF;
>commit;
>END;
>
>Unknown column 'chceckVote' in 'field list'
>
>whats wrong?



Change the "where" in your SET statement to "having"
Reply With Quote
  #3 (permalink)  
Old 04-23-2007
Kees Nuyt
 
Posts: n/a
Default Re: Procedure error: 'chceckVote' in 'field list'

On 23 Apr 2007 01:29:03 -0700, lukasz_sabat@o2.pl wrote:

>DECLARE checkVote smallint(2) DEFAULT 0;
>SET @checkVote = (select count(*) from vote
> where profilId=3 and >commentId=3);
>IF chceckVote=0 then

______^

One c too many...
--
( Kees
)
c[_] Solution: A more subtle problem. (#15)
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:03 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0