Jump to content

how to set up a variable using concat()


shadd

Recommended Posts

iam trying to set up a variable in a loop using concat like so:

set p=1;
loop2: WHILE p<=4 DO
					   SET concat('Opt_',p)='one';
					   SET p=p+1;
				END WHILE loop2;

but i get an error:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '('Opt_',p)='one';
                   the variables declared are Opt_1 to Opt_4

Edited by shadd
clarity
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.