MySQL Forums
Forum List  »  Stored Procedures

Re: Simple Stored Function not working
Posted by: Владислав Сокол
Date: January 01, 2022 07:43AM

When local variable (including compound statement parameter) name and column name interferes then the variable name is always preferred. Hence your

WHERE businessGroup = businessGroup

compares 2 copies of input variable - i.e. checks that the parameter value provided is not NULL.

You must specify table alias (which is impossible for a variable) for one of the names to be treated as column name:

WHERE vat.businessGroup = businessGroup

Options: ReplyQuote


Subject
Views
Written By
Posted
656
January 01, 2022 06:19AM
315
January 01, 2022 06:55AM
Re: Simple Stored Function not working
313
January 01, 2022 07:43AM


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.