The function string-needs-n-prefix
returns true if string needs to be prefixed by N when passed to database (default *default-database*).
The function string-prefix-with-n-if-needed can be used to add the prefix if needed. The function sql-expression with :n-qualified
can be used to unconditionally add the prefix.
At the time of writing, the prefix is required only when database is a connection to Microsoft SQL Server, and string contains characters which are not recognized by the code page of the server.
LispWorks User Guide and Reference Manual - 20 Sep 2017