Specifically MySQL, but I’m guessing the answer should be generic.
First I’m setting a variable as a number like so:
SET @somenumber:=LAST_INSERT_ID();
Note that LAST_INSERT_ID() is basically MySQL’s equivalent of SCOPE_IDENTITY(). Next I try to create a string by concatenating semicolons onto this number:
SET @somestring:=';'+@somenumber+';';
Last I try to insert this as a string:
INSERT INTO `sometable` (`somevarcharcolumn`) VALUES (somestring);
And the result is that only the number is added in the column and the semicolons are missing.
Can anyone point out what I’m doing wrong or what I need to do to make it work? Thank you much!
Hope this helps