Hi everyone!
We have a problem connecting to a SybaseDB via ar-jdbc 0.8.2 and jruby
1.1.4.
Connecting to the database directly via
ActiveRecord::Base.establish_connection …
ActiveRecord::Base.connection.execute(some-sql-statement)
works perfectly fine.
But trying to to this in a model, it doesn’t work.
I do a
class Test < ActiveRecord::Base
establish_connection :sybase_conn
set_table_name “schema_owner.tablename”
and on Test.find :all I get an error:
“ActiveRecord::ActiveRecordError: Table tablename does not exist”
That’s weird, because when I try a tablename that really doesn’t exist I
receive an error
“ActiveRecord::StatementInvalid: ActiveRecord::ActiveRecordError: ASA
Error -141: Table ‘dkjvk’ not found: SELECT * FROM schema_owner.dkjvk”
So, the connection to the DB works, because the ASA-error is the Sybase
Adaptive SQLAnywhere error.
Is there maybe a problem with the “schema_owner.” before the tablename?
I already tried to define quote_table_name in jdbc_sybase.rb, but didn’t
get better results.
Thanks for your help!
Tobi