Subject | Re: [firebird-support] Handling keywords as column names |
---|---|
Author | Milan Babuskov |
Post date | 2009-09-18T10:24:25Z |
Alec Swan wrote:
is because they are keywords. Imagine you have column named "FIRST" in
your table. In this case JDBC would need to include an SQL parser that
understands SQL syntax, so it knows which "FIRST" to quote:
select FIRST 10 FIRST from table;
select "FIRST" 10 "FIRST" from table;
select "FIRST" 10 FIRST from table;
select FIRST 10 "FIRST" from table;
Of these for cases, only the fourth one would work. Of course, this
could be done in the engine, but one can easily imagine how this
"fixing" of quoting could "fix" bad queries into ones that would run but
produce unexpected results.
--
Milan Babuskov
==================================
The easiest way to import XML, CSV
and textual files into Firebird:
http://www.guacosoft.com/xmlwizard
==================================
> I wonder if it's possible to configure the JDBC driver (Jaybird) to escapeHow would it work exactly? The main reason keywords need to be quoted
> keywords?
is because they are keywords. Imagine you have column named "FIRST" in
your table. In this case JDBC would need to include an SQL parser that
understands SQL syntax, so it knows which "FIRST" to quote:
select FIRST 10 FIRST from table;
select "FIRST" 10 "FIRST" from table;
select "FIRST" 10 FIRST from table;
select FIRST 10 "FIRST" from table;
Of these for cases, only the fourth one would work. Of course, this
could be done in the engine, but one can easily imagine how this
"fixing" of quoting could "fix" bad queries into ones that would run but
produce unexpected results.
--
Milan Babuskov
==================================
The easiest way to import XML, CSV
and textual files into Firebird:
http://www.guacosoft.com/xmlwizard
==================================