MySQL Forums
Forum List  »  Stored Procedures

Conditional IF Statement
Posted by: Jerry Hobbs
Date: May 25, 2017 08:09PM

This is a really a simple problem but I can't see what's wrong.

I am trying to put a simple conditional IF statement in a function and it won't work. Here is the statement:

IF (paindex = 1) THEN

paindex is an integer and the statement won't evaluate. It always passes and executes the IF statement. I have tried it with and without the parentheses. I've noticed that sometimes in my testing it even assigns one to paindex. In C# I can create a conditional statement with two equal signs like this (paindex == 1), but it won't work in mysql.

What am I doing wrong. Any tips will be greatly appreciated

Regards,

Options: ReplyQuote


Subject
Views
Written By
Posted
Conditional IF Statement
3584
May 25, 2017 08:09PM


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.