N
Nicolas Couturier
trying to use ruby (1.8.6) and activerecord(1.15.3) with oci adapter.
Tried this code :
require 'active_record'
ActiveRecord::Base.establish_connection(
:adapter => "oci",
:username => "scott",
assword => "ross",
:host => "DCFPROD")
class Credit < ActiveRecord::Base
set_table_name "dc_dossier"
set_primary_key "n_dossier"
end
p Credit.findfirst)
But got this error :
ORA-00942: table or view does not exist: select * from (select
raw_sql_.*, rownum raw_rnum_ from (SELECT * FROM dc_dossier ) raw_sql_
where rownum <= 1) where raw_rnum_ > 0 (ActiveRecord::StatementInvalid)
I googled a bit and found that i should try to add that to the Credit
class :
connection.execute('alter session set current_schema=DCFPROD')
Got that :
OCIError: ORA-01435: user does not exist: alter session set
current_schema=DCFPROD (ActiveRecord::StatementInvalid)
I'm clueless. I don't know much about Oracle.
Is there someone with an idea ?
THX.
Tried this code :
require 'active_record'
ActiveRecord::Base.establish_connection(
:adapter => "oci",
:username => "scott",
assword => "ross",
:host => "DCFPROD")
class Credit < ActiveRecord::Base
set_table_name "dc_dossier"
set_primary_key "n_dossier"
end
p Credit.findfirst)
But got this error :
ORA-00942: table or view does not exist: select * from (select
raw_sql_.*, rownum raw_rnum_ from (SELECT * FROM dc_dossier ) raw_sql_
where rownum <= 1) where raw_rnum_ > 0 (ActiveRecord::StatementInvalid)
I googled a bit and found that i should try to add that to the Credit
class :
connection.execute('alter session set current_schema=DCFPROD')
Got that :
OCIError: ORA-01435: user does not exist: alter session set
current_schema=DCFPROD (ActiveRecord::StatementInvalid)
I'm clueless. I don't know much about Oracle.
Is there someone with an idea ?
THX.