On Nov 19, 7:54 am, Drunkguy <[EMAIL PROTECTED]> wrote:
> This morning I was setting up a webservice for an oracle table and I
> noticed the results returned one of the columns as an OCI8::CLOB
> object.  I have read the ruby-oci8 
> documentation.http://ruby-oci8.rubyforge.org/en/api_OCI8CLOB.html
>
> Maybe I missed something, but this is the problem that I am having.  I
> am creating a dataset, but one of the columns is being returned as an
> OCI8::CLOB object.  When I call the available? method it returns true,
> but when I call the read() method I get an error.  The error I get is
> "OCIStillExecuting: Still Executing".  If I try to run any other
> methods with that column, I get this one, "OCIError: ORA-03127: no new
> operations allowed until the active operation ends".
>
> Here is my output from an IRB session:
>
> $ irb
> irb(main):001:0> require 'rubygems'
> => true
> irb(main):002:0> require 'sequel'
> => true
> irb(main):003:0> DB = Sequel.connect('oracle://
> ewall000:[EMAIL PROTECTED]:1522/RXRPRD')
> => #<Sequel::Oracle::Database: "oracle://
> ewall000:[EMAIL PROTECTED]:1522/RXRPRD">
> irb(main):004:0> @logs = DB[:nd_worklog].filter(:ticket_id =>
> 'ND005327825')
> => #<Sequel::Oracle::Dataset: "SELECT * FROM \"ND_WORKLOG\" WHERE
> (\"TICKET_ID\" = 'ND005327825')">
> irb(main):005:0> @logs.first[:details].available?
> => true
> irb(main):006:0> details = @logs.first[:details].read()
> OCIStillExecuting: Still Executing
>         from lob.c:57:in oci8lib.so
>         from /usr/lib/ruby/gems/1.8/gems/ruby-oci8-1.0.3/lib/oci8.rb:
> 1013:in `size'
>         from /usr/lib/ruby/gems/1.8/gems/ruby-oci8-1.0.3/lib/oci8.rb:
> 986:in `read'
>         from (irb):6
> irb(main):007:0>
>
> Can someone point me in the right direction or let me know what I am
> doing wrong?

This will probably require changes to the Oracle adapter.  In
fetch_rows, it should be calling read on all of the OCI8::CLOB objects
before it yields, so the user never has to do so manually.  Before
fetch_rows exits, the cursor is closed, and attempting to use read
afterward will probably give you an error.  I don't have access to an
Oracle database or really any significant experience with Oracle, so I
can't produce a patch, but hopefully I've given enough information for
you to give it a shot.

Jeremy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to