Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 36 lines (23 sloc) 0.787 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
Rodbtp is a ruby binding for the odbtp library
(http://odbtp.sourceforge.net)

To use you need to install first odbtp and
in the same directory compile rodbtp.c file,
futures release will have a correct extconf.rb,

To compile:

gcc -I. -I. -I/usr/lib/ruby/1.8/i486-linux -I. -fPIC -Wall -g -fno-strict-aliasing -O2 -fPIC -c rodbtp.c
gcc -shared -rdynamic -Wl,-export-dynamic -L"/usr/lib" -o rodbtp.so rodbtp.o odbtp.o sockutil.o -lruby1.8 -lpthread -ldl -lcrypt -lm -lc


Example:

require 'rodbtp'

rodb = Rodbtp.new
rodb.connect(hostname, tcp_port, odbc_string_connection)

qry = rodb.query("Select * from Customers")

qry.each do |row|
puts row.inspect
end

for row in qry.result
puts row.inspect
end

puts qry.fields
puts qry.ntuples
puts qry.num_fields

rodb.disconnect
Something went wrong with that request. Please try again.