Answer the question
In order to leave comments, you need to log in
How to insert value into LINESTRING?
I don't understand what the problem is. I create a function that has a variable with LINESTRING. I need to add value to it. As I understand it is just a string. But when I add value, nothing works. What is the correct way to add variables in such situations?
SET @g1 = 100;
SET @test = '100';
SET @g2 = 'LINESTRING(0 ' + @test + ', 100000 100)';
SELECT @g2;
Answer the question
In order to leave comments, you need to log in
In MySQL, strings are concatenated with the CONCAT() function
SET @g1 = 100;
SET @g2 = CONCAT('SELECT LINESTRING(0 ', @g1, ', 100000 100)');
SELECT @g2;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question