On Nov 19, 2:35 pm, Drunkguy <[EMAIL PROTECTED]> wrote:
> OK, I modified the fetch_rows in the oracle.rb. I made it so that it
> test the class of each column and if it is OCI8::CLOB, to read it.
>
> def fetch_rows(sql, &block)
> execute(sql) do |cursor|
> begin
> @columns = cursor.get_col_names.map {|c|
> c.downcase.to_sym}
> while r = cursor.fetch
> row = {}
> r.each_with_index do |v, i|
> puts "CLASS: #{v.class}"
> if v.class == OCI8::CLOB
> puts "Caught CLOB!"
> row[columns[i]] = v.read
> else
> row[columns[i]] = v unless columns[i] == :raw_rnum_
> end
> end
>
> yield row
> end
> ensure
> cursor.close
> end
> end
>
> I am still getting the same error when I test it in irb.
>
> 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
> CLASS: String
> CLASS: String
> CLASS: Bignum
> CLASS: String
> CLASS: String
> CLASS: NilClass
> CLASS: String
> CLASS: OCI8::CLOB
> Caught CLOB!
> OCIStillExecuting: Still Executing
> from lob.c:57:in
> oci8lib.so
>
> Is there something I need to do to the cursor?
I'm not sure. You might want to ask the ruby OCI8 people. It's
possible you have to finish using the cursor first (put results in a
temporary array), then do all the reads before you yield all of the
rows. It would be better to ask the ruby OCI8 how best to use it,
though.
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
-~----------~----~----~----~------~----~------~--~---