Ruby-mysql problem

Discussion in 'Ruby' started by George Moschovitis, Jul 15, 2004.

  1. 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.
     
    George Moschovitis, Jul 15, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. JL
    Replies:
    0
    Views:
    1,178
  2. Ravi
    Replies:
    6
    Views:
    1,444
    Suchandra Thapa
    Jul 21, 2003
  3. Replies:
    2
    Views:
    6,251
  4. Randy Lawrence

    mysql-ruby or ruby-mysql?

    Randy Lawrence, May 23, 2004, in forum: Ruby
    Replies:
    3
    Views:
    121
    Randy Lawrence
    May 24, 2004
  5. Mark Meijer

    mySQL Ruby Gem and MAMP mySQL

    Mark Meijer, Feb 2, 2008, in forum: Ruby
    Replies:
    3
    Views:
    236
    louis
    Feb 3, 2008
Loading...

Share This Page