I tried the following -
I created a variable at the command prompt as follows -
mysql> set @myId = 1;
Query OK, 0 rows affected (0.00 sec)
Then, to display it, I tried the following without success -
mysql> show myId;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'myId' at line 1
mysql> show @myId;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '@myId' at line 1
mysql> PRINT @myId;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'PRINT @myId' at line 1
mysql> PRINT myId;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'PRINT myId' at line 1
So how can I display the value of @myId
?