Comments - IF

4 years, 3 months ago David Blum

Wouldn't statement_list be one or more?

The reason I ask is - at least in a stored procedure I worked on today - it appears that only the FIRST statement in the "statement_list" executes. I remedied this by putting a BEGIN ... END; that started after the IF (or THEN, to be more specific) and ended just before the ELSE/END IF. This doesn't seem to be the behavior of the CASE structures I have in other stored procedures - and I don't recall if I had this issue before...which might be a commentary on how oblivious I am, but, is this the expected behavior?

My environment is MariaDB installed on a VICIdial / VICIbox system, MariaDB's version variable is showing a value of "10.1.6-MariaDB-log"

Thanks for any feedback / confirmation of what I am seeing...David

 
3 years, 11 months ago Tz-Ching Yu

I have the same problem too. Since statement list is one or more SQL statements, I think it should work for multiple statements without BEGIN END.

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.