[Tip] Using a MySQL database query that contains a string with semicolon

If you are using the SQL database connector then you might hit one limitation imposed by Klipfolio: your query can not have a string containing the ";" character. Even something as simple as:


would cause an error. This is because Klipfolio truncates your query at the first encountered ";" and ignores everything after that. This means the SQL server will actually receive the following as a query:


which is invalid (with an incomplete string.)

Now it depends on your specific SQL server. But at least with MySQL, you can instead use an hexadecimal literal string.

So the above query can instead be written as

SELECT x'3b'

1 comment

Please sign in to leave a comment.