From: ts Date: 2000-06-09T15:00:18+02:00 Subject: [ruby-talk:03221] Re: Ruby & Interbase -- Please answer if you know! >>>>> "J" == Jilani Khaldi writes: J> Now, how to get the output of the query? Well, I know nothing about interbase, but look at the file README. You have the different classes and the methods associated. For example, you have : ------------------------------------------------------------ execute(sql[,arg...]) sql SQL statement arg Argument to the above SQL statement Returns a newly created cursor object on success; nil on failure. conn.execute('select * from table1 where field1=?', 10) conn.execute('select * from table1 where field1=? and field2=?', 10, 'text1') conn.execute('insert into table1(field1, field2) values(?, ?)', 10, 'text1') ------------------------------------------------------------ Because it return a cursor, you can use the methods defined for the class Interbase::Cursor, like for example : ------------------------------------------------------------ each{|record|...} Iterates over each row of a query result. ------------------------------------------------------------ This mean that you can write something like this : require "interbase" conn = InterBase::connect('/ibase/employee.gdb', 'sysdba', 'masterkey') cursor = conn.execute('select * from employee') cursor.each do |record| # do something with the record end cursor.close Guy Decoux