MySQL Forums
Forum List  »  Newbie

Re: Why is it saying ' DECLARE' (declare) is not valid input at this position?
Posted by: Mark Kamoski
Date: June 21, 2016 11:24AM

OK, so then how is the datatype determined for a user variable in the following statement...


SET @MyUserVar = 0;

...???

Is the datatype of @MyUserVar determined dynamically at the time of assignment of a value to the variable?

If so, once the datatype is set, is it "sticky" such the following will fail...


SET @MyVar1 = 0;


SET @MyVar2 = 'test';

...??? Or is a true variant that hold anything? Or?

Just curious.

Thanks VERY much for your help.

-- Mark Kamoski

Options: ReplyQuote




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.