K
Ken Bloom
When I run the following query in DBI/Mysql, I'm finding that DBI is
returning the rho column as a string (rather than a float), thus forcing me
to convert it to a float with to_f. (I lose precision because the string
only returns the result to three decimal places). Any idea why DBI/Mysql is
returning the result of a numerical calculation as a string?
I'm running
mysql-5.0.34_alpha20070101-r61
mysql-ruby-2.7.2
ruby-dbi-0.0.21-r2
ruby-1.8.5_p2
on Gentoo.
dbh.execute("select childcounts.name name, childcounts.count/
parentcounts.count rho from parentcounts, childcounts where
parentcounts.left_key=childcounts.parent_left")
returning the rho column as a string (rather than a float), thus forcing me
to convert it to a float with to_f. (I lose precision because the string
only returns the result to three decimal places). Any idea why DBI/Mysql is
returning the result of a numerical calculation as a string?
I'm running
mysql-5.0.34_alpha20070101-r61
mysql-ruby-2.7.2
ruby-dbi-0.0.21-r2
ruby-1.8.5_p2
on Gentoo.
dbh.execute("select childcounts.name name, childcounts.count/
parentcounts.count rho from parentcounts, childcounts where
parentcounts.left_key=childcounts.parent_left")