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

string-prefix-with-n-if-needed Function

Summary

Adds the N syntax to a string if needed.

Package

sql

Signature

string-prefix-with-n-if-needed string &key database => result

Arguments
string
A string.
database
A database.
Values
result
A string or a sql-expression-object.
Description

The function string-prefix-with-n-if-needed checks if string, when passed to database, needs to be prefixed by N. If the prefix is required, it returns a sql-expression-object with the string prefixed. Otherwise it returns string.

Notes

string-prefix-with-n-if-needed is equivalent to:

(if (string-needs-n-prefix string :database database)
    (sql-expression :n-qualified string)
   string)
See also

23.5.1.6 SQL string literals
string-needs-n-prefix


LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:56