MySQL SET command not working

I try mysql query with SET, something like this:

SET @loan=123;
SELECT * from loan where id=@loan;

And it tells me that I have an error in my query (same query works with MySQL Workbench perfectly).
Is it issue with Metabase configuration/setting, or it’s just not supported?

Overall issue is close to the one described here:

but I didn’t see a response there that there are any problems with using SET, that’s why I wonder.

Currently we do not support multi-statement SQL expressions like this. So using the SET command to create a variable which is then used in a subsequent statement will indeed result in an error.

It would be great if you could file an issue on GitHub to track this as an rfe …

Hey @agileland

any update on this ?

I have just created an issue in github.

Hopefully this can be fixed soon. It has been about a year since it was asked for.

Hi Sukhanov,

set cases can be solved using variable

select * from load where id = {{variableName}}

This will ask to set the field values and you are done.

For more, please feel free to ping.