Subject Re: quotes in object names dialect 3
Author Roman Rokytskyy
Hi,

> as far as i understood developers thought what to do with getXXX()
> methods, but i have problems before getting the field but with
> passing a query to the server like this:
>
> String q = "select \"met\".id, iddt, changetime, code from \"met\" " +
> "inner join \"code\" on \"met\".id=\"code\".id where code = '" +
> cdmet + "'";
> Statement s = c.createStatement();
> ResultSet r = s.executeQuery(q);
>
> it says on executeQuery
>
> Column unknown
> met.ID

Driver does not parse query before sending it to the server, it sends
it as it is. Try your query in some tool first (IBExpert for example,
or even isql), there must be some problem elsewhere.

> before this i've escaped double quotes around all column names like
> this
>
> String q = "select \"met\".\"id\", \"iddt\"......... etc

Please post fully quoted query here, I suspect that you missed some
quotes there.

> the result was the same!
>
> (when used without any doublequotes, it said "Table unknown MET".)
>
> the database has _all_ identifiers, table and fieldname, in
> lowercase. i think i'll regret it :(

It will complicate your life, since each field has to be quoted.
Personally I use quoted identifiers only when I have to (e.g. some
word is reserved in Firebird, and I must use it as table/column name).

> still hope there is some modifier property, or i should rewrite all
> the database!...

There's no such property. If rewriting the database becomes a must,
you can create views that will convert you names to uppercase. If you
have table:

CREATE TABLE "atable" ("id" INTEGER);

you can create a view for it:

CREATE VIEW atable(id) AS SELECT "id" FROM "atable"

This view will be updatable (see InterBase documentation for more
info) and you will be able to SELECT id FROM atable, as well as INSERT
INTO atable (id) VALUES (1), etc.

Also if you believe there is a problem with the driver, post here an
example/test case that reproduces the issue, I will check it.

Best regards,
Roman Rokytskyy