MySQL Forums
Forum List  »  Newbie

Re: How to declare a variable in a script
Posted by: Peter Brawley
Date: April 29, 2022 11:36AM

MySQL doesn't follow Microsoft SQL dialect syntax.

1 MySQL supports begin...end and other such block constructs only in stored routines & Triggers.

2 System vars are referenced with 2 @ prefixes. Set system vars with SET, not with DECLARE, which is also supported only in stored routines & Triggers.

Declare and set user vars with SET, using just one @ prefix, eg ...

set @count=2;

Options: ReplyQuote


Subject
Written By
Posted
Re: How to declare a variable in a script
April 29, 2022 11:36AM


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.