Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Ruby-mysql problem

Reply
Thread Tools

Ruby-mysql problem

 
 
George Moschovitis
Guest
Posts: n/a
 
      07-15-2004
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem problem problem :( Need Help Mike ASP General 2 05-11-2004 08:36 AM



Advertisments
 



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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57