MySQL Forums
Forum List  »  Stored Procedures

Re: Always returns TRUE
Posted by: Peter Brawley
Date: July 08, 2020 10:15AM

If an sproc param name is the same as a table column, MySQL has no way of distinguishing the two, so
WHERE `DSPid`=dspid is always true.

Adopt a param naming convention that'll prevent such confusuon---eg start each param name with p_ and never do that with columns names---then stick to it.



Edited 1 time(s). Last edit at 07/08/2020 11:51AM by Peter Brawley.

Options: ReplyQuote


Subject
Views
Written By
Posted
766
July 08, 2020 04:53AM
Re: Always returns TRUE
402
July 08, 2020 10:15AM
384
July 08, 2020 11:28AM


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.