Hi,
After connect to my oracle database I have to switch the schema:
url = "jdbc:oracle:thin:#{ user}/#{ password}@#{ host}:#{
port}/#{service_name}"
opts = { after_connect: proc{|conn| conn.createStatement.execute("ALTER
SESSION SET CURRENT_SCHEMA =#{schema}")} }
DB = Sequel.connect(url, opts)
DB.autosequence = true
This works fine in all cases, when autosequence is not needed. But after an
insert I get following exception:
Sequel::Error: schema parsing returned no columns, table probably doesnt
exist
schema at C:/oracle-insert-test/jruby/lib/ruby/gems/shared/gems/sequel-4.32.
0/lib/sequel/database/query.rb:162
sequence_for_table at C:/oracle-insert-test/jruby/lib/ruby/gems/shared/gems/
sequel-4.32.0/lib/sequel/adapters/shared/oracle.rb:224
fetch at org/jruby/RubyHash.java:1181
sequence_for_table at C:/oracle-insert-test/jruby/lib/ruby/gems/shared/gems/
sequel-4.32.0/lib/sequel/adapters/shared/oracle.rb:221
last_insert_id at C:/oracle-insert-test/jruby/lib/ruby/gems/shared/gems/
sequel-4.32.0/lib/sequel/adapters/jdbc/oracle.rb:68
execute at C:/oracle-insert-test/jruby/lib/ruby/gems/shared/gems/sequel-4.32
.0/lib/sequel/adapters/jdbc.rb:260
statement at C:/oracle-insert-test/jruby/lib/ruby/gems/shared/gems/sequel-
4.32.0/lib/sequel/adapters/jdbc.rb:675
execute at C:/oracle-insert-test/jruby/lib/ruby/gems/shared/gems/sequel-4.32
.0/lib/sequel/adapters/jdbc.rb:248
hold at C:/oracle-insert-test/jruby/lib/ruby/gems/shared/gems/sequel-4.32.0/
lib/sequel/connection_pool/threaded.rb:105
synchronize at C:/oracle-insert-test/jruby/lib/ruby/gems/shared/gems/sequel-
4.32.0/lib/sequel/database/connecting.rb:256
execute at C:/oracle-insert-test/jruby/lib/ruby/gems/shared/gems/sequel-4.32
.0/lib/sequel/adapters/jdbc.rb:247
execute_insert at C:/oracle-insert-test/jruby/lib/ruby/gems/shared/gems/
sequel-4.32.0/lib/sequel/adapters/jdbc.rb:283
execute_insert at C:/oracle-insert-test/jruby/lib/ruby/gems/shared/gems/
sequel-4.32.0/lib/sequel/dataset/actions.rb:968
execute_insert at C:/oracle-insert-test/jruby/lib/ruby/gems/shared/gems/
sequel-4.32.0/lib/sequel/adapters/shared/oracle.rb:500
insert at C:/oracle-insert-test/jruby/lib/ruby/gems/shared/gems/sequel-4.32.
0/lib/sequel/dataset/actions.rb:338
(root) at super.rb:15
The Exception is thrown because the function *schema_parse_table_skip?(h,
schema)* in *sequel/adapters/jdbc/oracle.rb:102* does not have any schema
and the current_user is not the schema-owner.
I removed this function with an extension and inserts seem to work. I would
like to understand why this check is needed. And how this problem could be
solved in a “good” way.
Thanks!
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.