Last answered:

21 Nov 2022

Posted on:

18 Nov 2022

1

why NULL not error in new session?

Hi,
concerning @s_var1 variable, why in a new session there is an output NULL, not an error = "we don't have such a variable"? Was its name saved somewhere?
Regards
Margaret

1 answers ( 0 marked as helpful)
Instructor
Posted on:

21 Nov 2022

0

Hi Margaret!
Thanks for reaching out.

We cannot use this variable in another session because we defined it as a session variable. This is because it is NULL. There is no error, MySQL just displays NULL. You can test with another variable: @s_var2 and the result will be the same.

Hope this helps.
Best,
Tsvetelin

Submit an answer