Does active record really work for oracle

i get this when i try to unit test:

C:\railsspace>ruby c:\railsspace\test\functional\user_controller_test.rb
Loaded suite c:/railsspace/test/functional/user_controller_test
Started
…E.
Finished in 0.578 seconds.

  1. Error:
    test_registration_success(UserControllerTest):
    RuntimeError: “DESC users” failed; does it exist?
    (eval):3:in describe' C:/ruby186/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record /connection_adapters/oracle_adapter.rb:316:incolumns’
    C:/ruby186/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record
    /base.rb:763:in columns' C:/ruby186/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record /base.rb:2060:inattributes_from_column_definition_without_lock’
    C:/ruby186/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record
    /locking/optimistic.rb:45:in attributes_from_column_definition' C:/ruby186/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record /base.rb:1502:ininitialize_without_callbacks’
    C:/ruby186/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record
    /callbacks.rb:225:in initialize' c:/railsspace/config/../app/controllers/user_controller.rb:10:innew’
    c:/railsspace/config/…/app/controllers/user_controller.rb:10:in
    register' C:/ruby186/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controll er/base.rb:1095:insend’
    C:/ruby186/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controll
    er/base.rb:1095:in perform_action_without_filters' C:/ruby186/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controll er/filters.rb:632:incall_filter’
    C:/ruby186/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controll
    er/filters.rb:619:in perform_action_without_benchmark' C:/ruby186/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controll er/benchmarking.rb:66:inperform_action_without_rescue’
    C:/ruby186/ruby/lib/ruby/1.8/benchmark.rb:293:in measure' C:/ruby186/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controll er/benchmarking.rb:66:inperform_action_without_rescue’
    C:/ruby186/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controll
    er/rescue.rb:83:in perform_action' C:/ruby186/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controll er/base.rb:430:insend’
    C:/ruby186/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controll
    er/base.rb:430:in process_without_filters' C:/ruby186/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controll er/filters.rb:624:inprocess_without_session_management_support’
    C:/ruby186/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controll
    er/session_management.rb:114:in process_without_test' C:/ruby186/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controll er/test_process.rb:15:inprocess’
    C:/ruby186/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controll
    er/test_process.rb:382:in process' C:/ruby186/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controll er/test_process.rb:353:inpost’
    c:/railsspace/test/functional/user_controller_test.rb:50:in
    `test_registrati
    on_success’

4 tests, 12 assertions, 0 failures, 1 errors

def test_registration_success
post :register, :user => { :screen_name => “new_screen_name”,
:email => “[email protected]”,
:password => “long_enough_password” }
# Test assignment of user.
user = assigns(:user)
assert_not_nil user
# Test new user in database.
new_user = User.find_by_screen_name_and_password(user.screen_name,
user.password)
assert_equal new_user, user
# Test flash and redirect.
assert_equal “User #{new_user.screen_name} created!”, flash[:notice]
assert_redirected_to :action => “index”
end

Dave R. add:
def dba_connect
tns=“railt”
puts “NOW LOGGING ONTO BANNER #{tns}”
OCI8.new(“scott”,“tiger”,"#{tns}")
rescue OCIException
puts “NOW LOGGING ONTO BANNER #{tns}.WORLD”
OCI8.new(“scott”,“tiger”,"#{tns+".WORLD"}")
end
nil
$conn=dba_connect
LOGGING ONTO BANNER railt
#<OCI8:0x30c9fc4 @privilege=nil, @ctx=[0, #Mutex:0x30c9f88, nil,
65535], @
#OCISvcCtx:0x30c9f74, @prefetch_rows=nil>
recs=$conn.exec(“Desc Users”)
Error: ORA-00900: invalid SQL statement
from C:/ruby186/ruby/lib/ruby/site_ruby/1.8/oci8.rb:597:in
execute' from C:/ruby186/ruby/lib/ruby/site_ruby/1.8/oci8.rb:597:inexec’
from C:/ruby186/ruby/lib/ruby/site_ruby/1.8/oci8.rb:129:in
do_ocicall' from C:/ruby186/ruby/lib/ruby/site_ruby/1.8/oci8.rb:597:inexec’
from C:/ruby186/ruby/lib/ruby/site_ruby/1.8/oci8.rb:204:in exec' from (irb):20 recs=$conn.exec("Desc users") Error: ORA-00900: invalid SQL statement from C:/ruby186/ruby/lib/ruby/site_ruby/1.8/oci8.rb:597:inexecute’
from C:/ruby186/ruby/lib/ruby/site_ruby/1.8/oci8.rb:597:in exec' from C:/ruby186/ruby/lib/ruby/site_ruby/1.8/oci8.rb:129:indo_ocicall’
from C:/ruby186/ruby/lib/ruby/site_ruby/1.8/oci8.rb:597:in exec' from C:/ruby186/ruby/lib/ruby/site_ruby/1.8/oci8.rb:204:inexec’
from (irb):21
but
recs=$conn.exec(“select * from users”) …does

Dave R. wrote:

i get this when i try to unit test:

What version of Oracle? Which client are you using?

Thanks,
Tim

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs