Reputation: 2233
SET @session = '1'; SET @session = '[@session]';
SELECT @session;
This should print -: [1]
but it is printing [@session]
;
Whats the problem? Thanks for help..
Upvotes: 0
Views: 38
Reputation: 263733
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;
Upvotes: 1