Subject Re: Using reserve words in queries
Author Christopher Walls
--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@t...>
wrote:
> Yes, dialect 3 is the native dialect of Firebird and isql should
be
> creating dialect 3 databases by default. Quoted identifers are
valid in
> dialect 3 databases.
>
> If you used FlameRobin instead of isql to create your database,
and got a
> dialect database by default, then you should inform the FR
> developers. This is just an alpha version of the tool!! I
currently have
> Alpha 2, which can't create databases at all, because of a quoting
bug in
> the program, but it's interface certainly shows that it would
create a
> dialect 3 database.
>
> You can change the dialect of a database, using
>
> gfix -sq 3 <db-path> -u sysdba -pas xyxyxyxy
>
> But all that does is to change the dialect attribute and make the
dialect 3
> language features available for future work. It does NOT convert
existing
> data or data types or constraint calculations or recompile your
PSQL
> modules. BIG TROUBLE!! Most people have abandoned this as a way
to
> "convert" - since it is an illusion.
>
> Simply, the best, safest thing to do is to extract your metadata,
recreate
> your database from it as dialect 3 and then pump the data.
>
> Before going to this trouble, though, run a gstat -h on the
database just
> to be sure that you really do have this problem. May I also
suggest that
> you treat yourself as a field-tester for FlameRobin and NOT try to
use it
> to do things with databases that matter?
>
> How could the 1.5.2 version of isql create a dialect 1 database,
apparently
> by default? well, here's how it could have happened. You open an
isql
> session over a dialect 1 database - for example, employee.gdb that
ships
> with Firebird 1.0 and all of the Borland tools (up to and
including the
> latest versions of InterBase and Delphi). Isql detects that it is
> connecting to a dialect 1 database and sets the client dialect to
1. After
> fiddling about with this dialect 1 database, you decide to create
a new
> database. If you don't use a SET SQL DIALECT 3 command in isql
before
> creating this new database, it will be a dialect 1 database !!
(unless you
> actually ran a script that included that command...)
>
> ./heLen

I recreated my database file explicitly specifying SET SQL DIALECT
3; Once I did that I was able to escape the reserved words. I
appreciate your help and thank you for your time.

- Chris