I have written an SQL query in delphi that has a parameter
WHERE L1.IdListino = :IdListino
Based on some input from the user, I want this parameter to be either a field of a form (tParsIdListinoExport is the name of the field), or a column of another table (something like WHERE L1.IdListino = fat.IdListino).
if tParsIdListinoExport.AsString <> '' then
qSel.ParamByName( 'IdListino' ).AsString := tParsIdListinoExport.AsString
else
qSel.ParamByName( 'IdListino' ).Value := 'fat.IdListino';
end;
Sadly, looks like I can't insert a column name as a parameter, because it adds the '' around the name of the column, thus treating it as plain text. Is it possible to remove the '' from the parameter? Thank you very much,
Fabio
Format.