Subject Re: [firebird-support] Firebird and ODBC
Author Fidel Viegas
Michael> Error in GetLanguages:
System.Runtime.InteropServices.COMException(0x80004005): Dynamic SQL
Error SQL error
Michael> code = -104
Michael> Token unknown - line 1, char 13
Michael> [
Michael> at ADODB.RecordsetClass.Open(Object Source, Object
Michael> ActiveConnection, CursorTypeEnum CursorType, LockTypeEnum LockType,
Michael> Int32 Options)
Michael> at DWIWindowsService.DwiWindowsService.GetLanguage()

Michael> Among others.

Michael> As I read this, and as I have seen with i.e. MS SQL it looks like
the
Michael> SQL is:

Michael> Select xx from [TABLE] ....

Michael> And that the [ is not reconised by FB.


Hi Michael,

Delimited identifiers work differently in Firebird. You have to delimit them
using double quotes.

What the error is saying is that there is an error in your SQL code. In
other words the [ character.

Let's say that you have the following table:

create table employee (column1, column2, etc...);

You can use your table name in two different ways. Case insensitive or case
sensitive. In case insensitive way, you just use them as you have declared
them. That is, you can use employee, Employee, EMPLOYEE, EmPloYEE, etc...
They will all work.
Another way is using delimiters. In that case, the identifier name has to be
in uppercase. In this case "EMPLOYEE".

So, your query would be something like:

Select xx from "TABLE"

If you declare your table as follows:

create table "employee" (column1, column2, etc...)

Then, you have to reference your table using delimiters. But, in this case,
it is exactly as you declared it. That is "employee".

In conclusion: if you declare your table, column, views, procedures, etc...
in the normal way, they can be accessed in two ways: case sensitive using
delimiters and case insensitive without using delimiters. If you declare
them using delimiters, then they are case sensitive, and that is the only
way your can refer to them.

Hope that helped.

All the best,

Fidel.


[Non-text portions of this message have been removed]