I'm currently running SQL statements with variables like this
@set var1 = 'hello';
@set var2 = 'world';
select *
from "Table"
where col1 = ${var1};
So far this has been working perfectly fine but I recently tried to run a statement that contained the AND operator.
select *
from "Table"
where col1 = ${var1} and col2 = ${var2};
DBeaver throws the following error:
SQL Error [42601]: ERROR: syntax error at or near "and"
The SQL statement works when I run it like so
select *
from "Table"
where col1 = 'hello' and col2 = 'world';
Any ideas on how I can use two variables in one statement?