2
I need to run a query
where the value to be concatenated must be passed as a parameter for the query.
SELECT t.id || @p || t.nome FROM Test t;
But when executing this query it returns the following error: Dynamic SQL Error.
In Mysql this same idea works as follows:
SELECT CONCAT(t.id, @p, t.nome) FROM Test t;
I wonder if there is any way to do this kind of concatenation in Firebird? Because from what I understood the operator ||
is what causes this problem when a parameter is used.
Obs¹: It is necessary that the value to be concatenated as separator is passed by parameter.
Obs²: I know that if I concatenate the value in the query it works, the query will be executed this way:
select t.id || 'stringparaseparar' || t.nome from Test t;
, but in my case as mentioned above it is necessary that this value is passed by parameter. Ex: set @p = 'stringparaseparar'.
To clarify better the reason for this need follow that other issue that describes the origin of this problem.
it would be interesting if you put the error code.
– wesley luan
Already explicit in the question: Dynamic SQL Error.
– Fernando Leal
But there are several "Dynamic SQL Error". See reference with Firebird error codes
– wesley luan