Return whether a database connection accepts or requires the N syntax for non-ASCII strings.
sql
accepts-n-syntax &key database => nil-t-required
database⇩ |
A database object (default *default-database*). |
nil-t-required⇩ | t , nil or :required . |
The function accepts-n-syntax
returns nil-t-required to indicate the behavior of the N syntax for string literals in the database specified by database. (The N syntax prefixes a string literal by the character N.)
nil |
the database will give an error. |
t |
the database accepts it but does not require it. |
:required |
the database requires it (at least in some cases). |
Currently, Microsoft SQL Server (which can be used via ODBC) is the only supported database that requires the N syntax for non-ASCII strings. SQLite and Microsoft Access (via ODBC) give errors. The other supported databases accept the syntax but do not need it.
If you use the 23.5 Symbolic SQL syntax, then you can use the string pseudo-operator, which is described in 23.5.1.6 SQL string literals to obtain the correct syntax.
23.5.1.6 SQL string literals
23.12.4 Using non-ASCII strings on Microsoft SQL Server
string-needs-n-prefix
string-prefix-with-n-if-needed
LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:56