[ANN] ruby-oci8 0.1.10

K

KUBO Takehiro

Hi,

I've released ruby-oci8 0.1.10.
This is a Oracle module using OCI8 API.

URL:http://rubyforge.org/projects/ruby-oci8/

What's new:

1. bind a ref cursor as an OCI8::Cursor or a DBI::StatementHandle.
(requested by Stephen Flinter and Jason Sweat.)

Example:

# parse PL/SQL
plsql = conn.parse("BEGIN OPEN :cursor FOR SELECT * FROM emp; END;")
# bind :cursor as OCI8::Cursor
plsql.bind_param(':cursor', OCI8::Cursor)
# execute
plsql.exec
# get a bind value, which is an OCI8::Cursor.
cursor = plsql[':cursor']
# fetch results from the cursor.
while r = cursor.fetch()
puts r.join(',')
end

or

# parse/bind/execute PL/SQL
sth1 = dbh.execute("BEGIN OPEN ? FOR SELECT * FROM emp; END;", DBI::StatementHandle)
# get a bind value, which is a DBI::StatementHandle.
sth2 = sth1.func:)bind_value, 1)
# fetch results from the statement handle.
while r = sth2.fetch()
puts r.join(',')
end

Restriction:
* bind a ref cursor as output, but not as input.
That means you can get it from a pl/sql block, can't pass it to
the block.

2. bind LONG / LONG RAW as 65535-byte String.
(suggested by Graham Jenkins.)

Restriction:
* If the length is longer than 65535, I don't know what happen.
I haven't tested yet. (Sorry)

3. customizable default column data type of select statements.

Many people (Dmitry Maksyoma, Maik and Graham Jenkins) have requested
to support TIMESTAMP. But I haven't supported it yet. Though you can
fetch a TIMESTAMP data as an OraDate by adding the following code to
your code.

OCI8::BindType::Mapping[OCI8::SQLT_TIMESTAMP] = OCI8::BindType::OraDate

To fetch a DATE(oracle) as a Time(ruby).

OCI8::BindType::Mapping[OCI8::SQLT_DAT] = OCI8::BindType::Time

To fetch a NUMBER(oracle) as a Float(ruby) at all times.

OCI8::BindType::Mapping[OCI8::SQLT_NUM] = OCI8::BindType::Float
 
K

KUBO Takehiro

Sorry. Some bugs was found in ruby-oci8 0.1.10.
I've released ruby-oci8 0.1.10.1.
Please use it instead of 0.1.10.
 
D

Dido Sevilla

Hi,

I've released ruby-oci8 0.1.10.
This is a Oracle module using OCI8 API.

URL:http://rubyforge.org/projects/ruby-oci8/

Will this build against the Oracle Instant Client? The only reason why
I haven't used this code in the past and am currently using the
(apparently presently unmaintained) Ruby9i extension and struggling
with some of its bugs is because I previously found it too much work
to build ruby-oci8 against the Instant Client (10.1.0.3). While the
Instant Client libraries are indeed 40+ megs in size, they consist of
only three rpm files (including the ever-handy sqlplus), and are as
such a lot easier to install than an indeterminate amount of the
Oracle RDBMS wherever I need Oracle access.

I'd rather use well maintained code than have to deal with more bugs
in what is for all purposes abandoned code the future. Or at least
have you got some hints on how to use it with the Instant Client?
 
K

KUBO Takehiro

Dido Sevilla said:
Will this build against the Oracle Instant Client? The only reason why
I haven't used this code in the past and am currently using the
(apparently presently unmaintained) Ruby9i extension and struggling
with some of its bugs is because I previously found it too much work
to build ruby-oci8 against the Instant Client (10.1.0.3). While the
Instant Client libraries are indeed 40+ megs in size, they consist of
only three rpm files (including the ever-handy sqlplus), and are as
such a lot easier to install than an indeterminate amount of the
Oracle RDBMS wherever I need Oracle access.

I'd rather use well maintained code than have to deal with more bugs
in what is for all purposes abandoned code the future. Or at least
have you got some hints on how to use it with the Instant Client?

Yes. Please read README in ruby-oci8-0.1.10.1.tar.gz.
It has been compiled successfully in my environment.
But I received a mail saying it failed on Redhat Linux.
Please mail me the last 100 lines of 'ext/oci8/mkmf.log' when you failed.
 
D

Dido Sevilla

Yes. Please read README in ruby-oci8-0.1.10.1.tar.gz.
It has been compiled successfully in my environment.
But I received a mail saying it failed on Redhat Linux.
Please mail me the last 100 lines of 'ext/oci8/mkmf.log' when you failed.

Excellent. Works like a charm on both Gentoo and FC3, even without
the LD_PRELOAD black magic that seems to be unstable on the latter
platform.
 

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


Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top