I''m not entirely clear what is going on, but I am using the oci driver via Oracle Instant Client, and when I query out any fields from my database any NUMBER fields come back with a .0 appended to them. Did I do something wrong, or is there a way to turn this off? Thanks, Brian --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Brian Jones wrote:> I''m not entirely clear what is going on, but I am using the oci driver > via Oracle Instant Client, and when I query out any fields from my > database any NUMBER fields come back with a .0 appended to them. Did I > do something wrong, or is there a way to turn this off?Fixed in trunk. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
> -----Original Message----- > From: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > [mailto:rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] On Behalf Of > Michael A. Schoen > Sent: Wednesday, September 20, 2006 10:28 PM > To: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > Subject: [Rails] Re: Oracle returns floats, why? > > > > Brian Jones wrote: > > I''m not entirely clear what is going on, but I am using the > oci driver > > via Oracle Instant Client, and when I query out any fields from my > > database any NUMBER fields come back with a .0 appended to > them. Did > > I do something wrong, or is there a way to turn this off? > > Fixed in trunk.How was it fixed, exactly? The Oracle NUMBER type can be integer or floating point (it''s actually stored internally in decimal format). Are you checking the scale, and returning an integer only if the scale is zero? - Dan This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Berger, Daniel wrote:> How was it fixed, exactly? The Oracle NUMBER type can be integer or > floating point (it''s actually stored internally in decimal format). Are > you checking the scale, and returning an integer only if the scale is > zero?Yep. So if the column is explicitly defined in the db as being an integer, you get an integer. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
When you say ''trunk'', is that the OCI8 driver? Ruby? Or Rails? I checked EdgeRails into my project, but the same problem occurs. Guessing that wasn''t it? Brian --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Brian Jones wrote:> When you say ''trunk'', is that the OCI8 driver? Ruby? Or Rails? > > I checked EdgeRails into my project, but the same problem occurs. > Guessing that wasn''t it? > > > BrianWell, I dug through the source files and saw the changes in active_record/connection_adapters/oracle_adapter.rb, however they don''t seem to be fixing the issue. I checked my database NUMBER columns, and they are set correctly as well. Do I still have something misconfigured? Brian --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---