SET @session = '1'; SET @session = '[@session]';
SELECT @session;
This should print -: [1] but it is printing [@session];
Whats the problem? Thanks for help..
The result is as expected. [@session] was the last value that was set to variable @session.
SET @session = '1'; -- <<== first value
SET @session = '[@session]'; -- <<== second value (overrides the first value)
SELECT @session;
i think you mean,
SET @session = '1';
SET @session = CONCAT('[', @session, ']');
SELECT @session;
[1]. How to get this?