Subject RE: [IBO] Quoted object names in TIB_Script component
Author Helen Borrie
At 01:02 PM 13/07/2006, you wrote:

> > It depends. First do a reality check to make sure that the database
> > that your IB_Script is accessing is Dialect 3. Quoted identifiers
> > are unknown tokens in Dialect 1 databases.
> >
>
>And that was it! I did SET SQL DIALECT 3; before the CREATE DATABASE
>and all was well.
>
>Which brings up another question: In "The Firebird Book", pg 233, it says
>that Firebird always creates a dialect 3 database by default, which is
>why I left it out in the first place. And just to be on the safe side,
>I had set the SQLDialect property to 3 in the TIB_Connection object that
>was associated with the TIB_SCRIPT.
>
>Why would it have created a dialect 1 database, absent the SET SQL DIALECT
>command?

SQL dialect has two sides.

On the one hand, a dialect 3 database is a database in which the full
language features of IB 6.0 and Firebird are implemented. A dialect
1 database is one where the language features of IB 5.6 are
implemented but not all of the later features.

On the other hand, the client library can't deal with the database
it's connecting to unless it knows which dialect it is supposed to be
using. So, if you connect to a dialect 1 database using a dialect 3
client, or vice versa, you are going to encounter exception conditions.

Now, a TIB_Connection is a connection *to a database*. So you have a
bootstrap situation if your TIB_Connection is "connecting" to a
database that doesn't exist yet. As far as I know, IBO still
*creates* a dialect 1 database by default. Once it has created the
database, it can *then* follow your instruction and connect to it as
a dialect 3 client. But that's too late. Because the database
dialect wasn't set *before* the CREATE DATABASE statement, IBO didn't
know you wanted a dialect 3 database.

If you ask "Does Helen think Jason should consider making Dialect 3
the default, seven years on from IB 6?" the answer is simply
"Yes". Firebird's isql has been creating Dialect 3 databases by
default since 2003 and "to everything, there is a season".

Helen