MySQL Forums
Forum List  »  Stored Procedures

Re: Nested If problem
Posted by: Russel James
Date: April 27, 2016 05:29AM

The above code looks much better but it gives me an error

Here is my code:

CREATE PROCEDURE `testStatementsForCountry` (
IN p_countryID varchar(7),
IN p_overdueOnly boolean,
IN p_nonEmail boolean
)
BEGIN

SELECT IF(p_overdueOnly, 2,
IF(p_countryID = "DE", 1,
IF(p_countryID = "BE",3)));

END


Syntax Error: ')' (closing parenthesis) is not valid input at this position.

It is pointing at the first closing balance after the 3.

Any ideas ??


J

Options: ReplyQuote


Subject
Views
Written By
Posted
3030
April 26, 2016 02:10PM
721
April 26, 2016 05:49PM
686
April 26, 2016 11:20PM
Re: Nested If problem
1072
April 27, 2016 05:29AM
759
April 27, 2016 08:14AM


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.