Ruby-mysql problem

G

George Moschovitis

Hello everyone,

I have a small problem with ruby-mysql.

lets say I have the following SQL Table:

CREATE TABLE MyTable
oid INTEGER,
pid INTEGER,
body TEXT
);

when I execute a query like this:

rows = db.query("SELECT * FROM MyTable WHERE oid=2")

I get back a resultset:

rows.each { |row|
puts row[1].class
}

I was surprised to see that row[1] is a String and NOT
a Fixnum, ie the types are lost. Is there any neat solution
to this problem?

Thanks in advance for any help!

George Moschovitis


--
www.navel.gr | tel: +30 2106898050 | fax: +30 2106898437

Navel does not accept liability for any errors, viruses or omissions in
the contents of this message. The full corporate policy is available on
our site.
 

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,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top