I like to create a querry tag in an UDT using a parameter resulting in an error

HI!
I'm want to query the name of a machine from a mySQL-DB in an UDT using a parameter (Ignition 8.3.4).
The Parameter is defined as a string with the value machineCode1(Without any ' )

SELECT machineName 
FROM table 
WHERE machineCode = {parameter1}

The Tag results in the following error: Error_ExpresionEval("Unknown column 'machineCode1' in 'where clause'")

If I read the tag in a script withsystem.tag.readBlocking(machine1/Parameters.parameter1", 100)[0].value) and use the same query in a system.db.runPrepQuery() it returns the correct value.

If I replace {paramter} with 'machineCode1' directly the querry tag returns the correct name.
If I set {paramter} to 'machineCode1' (with the ') the query also returns the correct name, but the scripts do not return anything anymore (which makes sense, as the DB does not have an entry with ' )

What am I missing? Is this an inconsistency in type handling?

Thanks for your Input!

that error would indicate it's looking for a column(field) with the name machineCode1. Which makes me think you're query isn't actually the query that is running. what are the actual column names in your table?

I would suggest you make a named query and pass the parameter to it that way

I don't use query tags, but does this work?

SELECT machineName 
FROM table 
WHERE machineCode = '{parameter1}'