Closed ycliuhw closed 2 months ago
For use cases like this I would recommend using CONCAT
. For example you could do:
SELECT name FROM user WHERE name LIKE CONCAT($M.name_prefix, '%')
The limitation of not parsing query input parameters in quotes, either "
or '
applies also to regular ?
SQL query parameters. In SQLair we purposefully pass over anything contained in quotes.
Yeah, this could be a workaround. Thanks, @Aflynn50 .
The problem is that if we want to use regex
or
LIKEin SQLite, we have to quote the value. However, I found that SQLair currently ignores any parameters in quotations. For example, the
name_prefixparameter in
WHERE name LIKE '$M.name_prefix%'will be ignored by sqlair. Then, the SQLite raises an error:
invalid input parameter: argument of type \"M\" not used by query`.