Ruby-OCI8 on Windows XP

http://d.hatena.ne.jp/Kazzz/20090314/p1 を参考に

動作環境

Windows XP SP3 + 10gR2(クライントをほぼフル) -> CentOS 5.3 + 10gR2

>gem install ruby-oci8 -v 1.0.5

Select which gem to install for your platform (i386-mswin32)

1. ruby-oci8 1.0.5 (i386-mswin32)

2. ruby-oci8 1.0.5 (ruby)

3. Skip this gem

4. Cancel installation

> 1

Successfully installed ruby-oci8-1.0.5-i386-mswin32

Installing ri documentation for ruby-oci8-1.0.5-i386-mswin32...

Installing RDoc documentation for ruby-oci8-1.0.5-i386-mswin32...

Docより

OCI8.new(userid, password, dbname = nil, privilege = nil)

dbname は Net8 の接続文字列です。

c:\>irb

irb(main):001:0> require 'OCI8'

=> true

irb(main):002:0> con = OCI8.new("hr", "hr", dbname)

=> #<OCI8: 略・・・・

irb(main):003:0> con.exec('select * from dual') do |r| puts r.join(', '); end

X

=> 1

irb(main):004:0>