hi
I have the latest rails version and would like
to connect to an Oracle 9 database:
this is my code:
========ActiveRecord::Base.establish_connection(
:adapter => "oci",
:host => "host",
:username => "user",
:port => 1888,
:password => "passwd",
:database => "tmp1"
)
class Customer < ActiveRecord::Base
set_primary_key "customerno"
set_table_name ="TMP.CUSTOMERS"
end
c = Customer.find(10027566)
=============
TMP is the schema name
this is the error message:
/usr/local/lib/ruby/site_ruby/1.8/oci8.rb:161:in
`attach'': ORA-12154: TNS:could not resolve service
name (OCIError)
from
/usr/local/lib/ruby/site_ruby/1.8/oci8.rb:161:in
`initialize''
from
/usr/local/lib/ruby/site_ruby/1.8/oci8.rb:161:in
`do_ocicall''
from
/usr/local/lib/ruby/site_ruby/1.8/oci8.rb:161:in
`initialize''
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/oci_adapter.rb:211:in
`new''
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/oci_adapter.rb:211:in
`oci_connection''
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/query_cache.rb:52:in
`send''
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/query_cache.rb:52:in
`connection=''
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/abstract_adapter.rb:108:in
`retrieve_connection''
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/base.rb:239:in
`connection''
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/base.rb:679:in
`sanitize''
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/base.rb:354:in
`find''
from ./gmxdb.rb:23
the oracle driver and libraries are installed.
the host and port are correct because I also use
this with the Tora GUI client for oracle.
any ideas what''s wrong here ?
regards
Markus
___________________________________________________________
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden:
http://mail.yahoo.de