2

i try to check my IN param with a regexp but always is a error

BEGIN
declare clausolein varchar(255);
IF POST_FARMS is null THEN
SET clausolein=1;
ELSE IF POST_FARMS REGEXP '^[1-9]' THEN
SET clausolein=2;
ELSE
SET clausolein=3;
END IF;
SELECT clausolein;
END
2
  • 1
    What does the error say? Commented Apr 22, 2014 at 13:25
  • 1
    right syntax to use near '' Commented Apr 22, 2014 at 14:18

1 Answer 1

2

Please study thoroughly this link: http://dev.mysql.com/doc/refman/5.7/en/if.html

13.6.5.2 IF Syntax

IF search_condition THEN statement_list
   [ELSEIF search_condition THEN statement_list] ...
   [ELSE statement_list]
END IF

and then please compare the above syntax with your code:

ELSE   IF  POST_FARMS REGEXP '^[1-9]' THEN

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.