On Monday, September 17, 2012 4:18:59 PM UTC-7, lkfken wrote: > > Hello, > > I am currently using JDBC (from Microsoft) to connect to MSSQL with no > issues. > > Then I try to use JTDS (from the jTDS Project) as the adapter and I got > the following when executing a statement: > > Sequel::DatabaseError: Java::JavaSql::SQLException: Invalid object name > 'MEMBERS_BASE_VIEW'. > raise_error at > C:/jruby-1.7.0.preview2/lib/ruby/gems/shared/gems/sequel-3.39.0/lib/sequel/database/misc.rb:316 > statement at > C:/jruby-1.7.0.preview2/lib/ruby/gems/shared/gems/sequel-3.39.0/lib/sequel/adapters/jdbc.rb:544 > execute at > C:/jruby-1.7.0.preview2/lib/ruby/gems/shared/gems/sequel-3.39.0/lib/sequel/adapters/jdbc.rb:243 > hold at > C:/jruby-1.7.0.preview2/lib/ruby/gems/shared/gems/sequel-3.39.0/lib/sequel/connection_pool/threaded.rb:105 > hold at > C:/jruby-1.7.0.preview2/lib/ruby/gems/shared/gems/sequel-3.39.0/lib/sequel/connection_pool/threaded.rb:94 > synchronize at > C:/jruby-1.7.0.preview2/lib/ruby/gems/shared/gems/sequel-3.39.0/lib/sequel/database/connecting.rb:233 > execute at > C:/jruby-1.7.0.preview2/lib/ruby/gems/shared/gems/sequel-3.39.0/lib/sequel/adapters/jdbc.rb:242 > execute at > C:/jruby-1.7.0.preview2/lib/ruby/gems/shared/gems/sequel-3.39.0/lib/sequel/dataset/actions.rb:762 > fetch_rows at > C:/jruby-1.7.0.preview2/lib/ruby/gems/shared/gems/sequel-3.39.0/lib/sequel/adapters/jdbc.rb:618 > each at > C:/jruby-1.7.0.preview2/lib/ruby/gems/shared/gems/sequel-3.39.0/lib/sequel/dataset/actions.rb:149 > single_record at > C:/jruby-1.7.0.preview2/lib/ruby/gems/shared/gems/sequel-3.39.0/lib/sequel/dataset/actions.rb:533 > first at > C:/jruby-1.7.0.preview2/lib/ruby/gems/shared/gems/sequel-3.39.0/lib/sequel/dataset/actions.rb:206 > > Why 'MEMBERS_BASE_VIEW' is an "Invalid object name"? How do I resolve > this? > > By the way, I checked and Ruby Sequel is able to return a correct (and > same) statement with either JDBC or jTDS. > pp Member.filter(:mem_no => '000123456*01') > #<Sequel::JDBC::JTDS::Dataset: "SELECT * FROM [MEMBERS_BASE_VIEW] WHERE > ([MEM_NO] = N'000123456*01')"> > > and this is the same statement if I use JDBC > pp Member.filter(:mem_no => '000123456*01') > #<Sequel::JDBC::Dataset: "SELECT * FROM [MEMBERS_BASE_VIEW] WHERE > ([MEM_NO] = N'000123456*01')"> > I'm not sure why you would get this, but isn't it more likely to be a jTDS issue than a Sequel issue? After all, isn't Sequel sending the correct SQL for your query?
The other possibility is that you are connecting to a different database via jTDS that doesn't have that table/view defined. You didn't list your connection strings, so that's just a shot in the dark. Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/sequel-talk/-/mVVIib4Bh50J. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en.
