Hello,
I’m running a Rails 2.2.2 application on an Oracle database. To access
tables in a different schema without public synonyms we have defined our
model classes like this:
class SKey < ActiveRecord::Base
set_table_name ‘lnx.s_key’
…
end
When I try to find SKey objects in the database, then I get with
AR-JDBC-
Adapter 0.9.0 the following statement:
SELECT * FROM lnx.s_key WHERE (lnx.s_key.s_topic = ‘cprocessing’ AND
lnx.s_key.s_subtopic = ‘cprocessing’ AND lnx.s_key.s_keyword = ‘NILI’)
Newer versions of AR-JDBC-Adapter (e.g. 0.9.2) produce:
SELECT * FROM “lnx.s_key” WHERE (“lnx.s_key”.s_topic = ‘idelivery’ AND
“lnx.s_key”.s_subtopic = ‘idelivery’ AND “lnx.s_key”.s_keyword = ‘NILI’)
The difference is that the version > 0.9.0 quotes the table names and
thus
invalidates the statements.
The only working quotation were “LNX”.“S_KEY” for the example above. But
I
don’t see a way to make this work without taking out the schema from the
name. (In that case I’d write only the table name and in upper case.)
I’ve also found that the table name is only quoted if I specify it
explicitly in the class. If I comment set_table_name, the table name is
set
to s_keys (without quotation) - it’s just that we have s_key in the
database, it would work if the table name were in plural.
Can somebody give me a hint about what place needs to be looked at in
the
adapter?
Thanks in advance
Andreas
Andreas G.
Otto Group · Group Technology Partner (GTP)
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email