Re: [q-lang-users] ODBC connection with MS Access
Brought to you by:
agraef
From: Tim H. <q...@st...> - 2008-02-13 00:44:23
|
Albert Graef <Dr....@t-...> writes: > BTW, does anyone here know a _portable_ way to quote column names which > are also SQL keywords? (MS SQL doesn't like these.) ANSI SQL mandates > double quotes, which works with both Access and PostgreSQL out of the > box, but not with MySQL. :( SQLGetInfo(SQL_IDENTIFIER_QUOTE_CHAR) is your friend: | SQL_IDENTIFIER_QUOTE_CHAR(ODBC 1.0) | | The character string that is used as the starting and ending | delimiter of a quoted (delimited) identifier in SQL statements. | (Identifiers passed as arguments to ODBC functions do not have to be | quoted.) If the data source does not support quoted identifiers, a | blank is returned. | | This character string can also be used for quoting catalog function | arguments when the connection attribute SQL_ATTR_METADATA_ID is set | to SQL_TRUE. | | Because the identifier quote character in SQL-92 is the double | quotation mark ("), a driver that conforms strictly to SQL-92 will | always return the double quotation mark character. <http://msdn2.microsoft.com/en-us/library/ms711681(VS.85).aspx> Beware that, in m$loth terminology, "a blank" means either NULL or a space character depending what they were smoking at the time. HTH :) ~Tim -- <http://spodzone.org.uk/> |