> > Is "From" a legal column name? Doesn't seem so... I get a syntax error
> > exception. But I've inherited a database with a From column. What can I
[quoted text clipped - 14 lines]
>
> 1 record(s) selected.
Interesting ... and very weird. However, it is definitely illegal for SQL92.
> Question is whether "From" column name is stored in your catalog as Uppercase F
> followed by lowercase r o m. If so - try quoting exactly like it is spelled:
>
> select "From" from ....
>
> as suggested before.
Yes, that is correct for SQL92, which is case-sensitive for quoted names.

Signature
Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com)
==============================================================
* The Ultimate DBMS is here!
* FirstSQL/J Object/Relational DBMS (http://www.firstsql.com)
aaronfude@gmail.com - 19 Apr 2006 05:30 GMT
Hi,
Thanks for all the responses.
So would it be a good idea to write all column names in quotes. (All of
my SQL is computer generated so this would be a trivial change.)
Thanks again!
Aaron
Lee Fesperman - 19 Apr 2006 21:40 GMT
> Hi,
>
> Thanks for all the responses.
>
> So would it be a good idea to write all column names in quotes. (All of
> my SQL is computer generated so this would be a trivial change.)
That's a tough question! Not all SQL-DBMSs support using double-quotes to quote names.
Support for ANSI SQL is very spotty. IOW, establising a convention like that won't be
portable. I think your SQL generator needs to accept properties to control generation so
the generation can be tailored to specific SQL backends.

Signature
Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com)
==============================================================
* The Ultimate DBMS is here!
* FirstSQL/J Object/Relational DBMS (http://www.firstsql.com)
Lee Fesperman - 21 Apr 2006 00:49 GMT
> > Hi,
> >
[quoted text clipped - 7 lines]
> portable. I think your SQL generator needs to accept properties to control
> generation so the generation can be tailored to specific SQL backends.
Oops, not as tough as I said! I had forgotten the getIdentifierQuoteString() method in
java.sql.DatabaseMetaData. With luck, that will enable you to properly quote names in a
portable manner.
For full generality, a SQL generator I wrote allowed you to override the
getIdentifierQuoteString() result on option. It also scanned the name to double any
quote character when the quote string was a single character and not a space. Note: I
just checked the code, since my memory was obviously dim ;^)

Signature
Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com)
==============================================================
* The Ultimate DBMS is here!
* FirstSQL/J Object/Relational DBMS (http://www.firstsql.com)