Connection.quoteSqlIdentifier

Use this method to get a correctly quoted (if necessary) SQL identifier which can be used in SQL statements, from id. If id is already correctly quoted for cnc, then a copy of id may be returned.

This method may add double quotes (or other characters) around id: <itemizedlist> <listitem><para>if id is a reserved SQL keyword (such as SELECT, INSERT, ...)</para></listitem> <listitem><para>if id contains non allowed characters such as spaces, or if it starts with a digit</para></listitem> <listitem><para>in any other event as necessary for cnc, depending on the the options passed when opening the cnc connection, and specifically the <link linkend="GDA-CONNECTION-OPTIONS-SQL-IDENTIFIERS-CASE-SENSITIVE:CAPS"> GDA_CONNECTION_OPTIONS_SQL_IDENTIFIERS_CASE_SENSITIVE</link> option.</para></listitem> </itemizedlist>

One can safely pass an already quoted id to this method, either with quoting characters allowed by cnc or using the double quote (") character.

class Connection
string
quoteSqlIdentifier
(
string id
)

Parameters

id string

an SQL identifier

Return Value

Type: string

a new string, to free with glib.global.gfree once not needed anymore