All Manuals > LispWorks User Guide and Reference Manual > 47 The SQL Package

NextPrevUpTopContentsIndex

accepts-n-syntax

Function
Summary

Return whether a database connection accepts or requires the N syntax for non-ASCII strings.

Package

sql

Signature

accepts-n-syntax &key database => nil-t-required

Arguments

database

A database object (default *default-database*).

Values

nil-t-required

t, nil or :required.

Description

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-t-required can be one of:

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 Symbolic SQL syntax, then you can use the string pseudo-operator, which is described in SQL string literals to obtain the correct syntax.

See also

SQL string literals
Using non-ASCII strings on Microsoft SQL Server
string-needs-n-prefix
string-prefix-with-n-if-needed


LispWorks User Guide and Reference Manual - 20 Sep 2017

NextPrevUpTopContentsIndex