ruby-oci8-1.0.0 rowid

A

Amos

I noticed this apparently unanswered thread:

http://groups.google.com/group/comp.lang.ruby/browse_frm/thread/2ae6af9717678d39/cf37b223d5f7231f

It would seem that this is still a problem? I'm trying to port some
old code from oracle-0.2.11 to ruby-oci8-1.0.0 and for the most part
it is working. However, I can't seem to figure out how to access the
rowid from oci8. I've got a simple query that I set up with the parse
method, then do:

cur.exec
while r = cur.fetch()
p r
p cur.rowid()
end
cur.close

But unfortunately get:

attr.c:261:in oci8lib.so: No Data (OCINoData)
from /opt/ruby/oci8/oci8.rb:817:in `rowid'

Anyway around this? I need to use the newer Oracle library because I
need to use a "//server:port/dataset" connection string that the older
library doesn't seem to support.

I guess I may have to bail on using Ruby and convert it over to Java
like what the reset of the group is doing.

Amos
 
A

Amos

It would seem that this is still a problem? I'm trying to port some
old code from oracle-0.2.11 to ruby-oci8-1.0.0 and for the most part
it is working. However, I can't seem to figure out how to access the
rowid from oci8.


It was pointed out to me that this works for ruby-oci8-1.0.0:


cursor = conn.parse('select rowid, t.* from dual t')
cursor.define(1, String, 23) # fetch 1st column as a String.
cursor.exec
while row = cursor.fetch
puts row[0]
end

As for OCI8::Cursor#rowid, it is available to get rowids of inserted
rows.

cursor = conn.parse('insert into foo values (1, 2)')
cursor.exec
rowid = cursor.rowid # inserted row's rowid.


Amos
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

[ANN] ruby-oci8 1.0.0 0
[ANN] ruby-oci8 1.0.4 and 2.0.0 0
[ANN] ruby-oci8 2.0.5 0
[ANN] ruby-oci8 1.0.0-rc3 0
[ANN] ruby-oci8 2.0.6 0
[ANN] ruby-oci8 1.0.0-rc1 0
[ANN] ruby-oci8 1.0.0-rc2 1
[ANN] ruby-oci8 1.0.1 4

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top