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"