Skip to content

cfiorini/rodbtp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

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

About

Ruby binding for odbtp library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages