Page 1 of 1

bad result

Posted: Thu Sep 17, 2009 8:00 am
by dejvos
Hello,

I'have a problem with my function:

Code: Select all

 
CREATE FUNCTION MovePhoto(oldFile VARCHAR(255), newFile VARCHAR(255), cmp CHAR(36))
RETURNS INT
BEGIN
DECLARE c INT;
SELECT COUNT(*) INTO c FROM photo WHERE name = @newFile;
RETURN c;
END//
 
It doesn't return result which I expected - it's always '0' but I'm absolutely sure that the function should returns something else.

Anybody knows where is the problem?

Thanks!

Re: bad result

Posted: Fri Sep 18, 2009 2:18 am
by dejvos
I've found it - I can't use at sign in the query.