sqlrelay and dbi

R

Raphael Bauduin

Hi,

I'm accessing a mssql server through sqlrelay and dbi.
My problem is that I can't get to the value of a colomn in a row:
the first column returns as value the concatenation of all columns in the row......

Here is the code:

query = "select TOP 10 * from table"
rows = @dbh.select_all(query)



#column 0 of row 0 gives 14559 but should return 1
rows.at(0).at(0)
rows[0][0]

#column 1 of row 0 gives nothing but should return 45
rows.at(0).at(1)
rows[0][0]

#column 2 of row 0 gives nothing but should return 59
rows.at(0).at(1)
rows[0][0]

#joining the elements of the array separates columns fine
#and I use that to make it work, but
rows2=Array.new
rows2=rows.each { |r| rows2.push r.join("--").split(/--/)}


Did anyone of you have the same problem and maybe find a better solution?

I'm using sqlrelay 0.34.3-1, ruby 1.8.1-3, libdbi-ruby1.8 0.0.21-3 on debian.

Thanks.

Raph
 

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

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,149
Latest member
Vinay Kumar Nevatia0
Top