Bala
2007-Sep-27 06:05 UTC
ORA-01858: a non-numeric character was found where a numeric was expected
Hi Experts, When i execute this statement i got an error called ORA-01858 mobile_number = ''1234567890'' email = "testing-vRmjhqX1jfVBDgjK7y7TUQ@public.gmane.org" secret_question = "whats your name" secret_answer = "crystal" date_of_birth = "20-SEP-90" User.find(:first, :conditions => "mobile_number=''#{mobile_number}'' and email=''#{email}'' and date_of_birth=''#{date_of_birth}'' and secret_question=''#{secret_question}'' and secret_answer=''#{secret_answer}''") ORA-01858: a non-numeric character was found where a numeric was expected but when i execute as query in BE its working well, anyhow, i''ve tried using to_date(''#{date_of_birth}'', ''dd-mon-yy'') the query executes well with none record return, but i''ve the value of "20-SEP-90" on my db anyway, i''ve a model Users with date_of_birth column with the type of :date any suggestions? is there any difference between rails date and oracle date? thanks in advance Experts waiting for the reply, regards, Bala --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
lianliming
2007-Sep-27 07:37 UTC
Re: ORA-01858: a non-numeric character was found where a numeric was expected
Hi, Bala You have to use Class Date to wrap the your date_of_birth string, Try following: date_of_birth=Date.new(1990,9,20) And execute your query statement again to see if it can get correct result. Regards, Liming On Sep 27, 2:05 pm, Bala <mbb...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi Experts, > > When i execute this statement i got an error called ORA-01858 > > mobile_number = ''1234567890'' > email = "test...-vRmjhqX1jfVBDgjK7y7TUQ@public.gmane.org" > secret_question = "whats your name" > secret_answer = "crystal" > date_of_birth = "20-SEP-90" > > User.find(:first, :conditions => "mobile_number=''#{mobile_number}'' and > email=''#{email}'' and date_of_birth=''#{date_of_birth}'' and > secret_question=''#{secret_question}'' and > secret_answer=''#{secret_answer}''") > > ORA-01858: a non-numeric character was found where a numeric was > expected > > but when i execute as query in BE its working well, anyhow, i''ve tried > using to_date(''#{date_of_birth}'', ''dd-mon-yy'') the query executes well > with none record return, but i''ve the value of "20-SEP-90" on my db > > anyway, i''ve a model Users with date_of_birth column with the type > of :date > > any suggestions? > > is there any difference between rails date and oracle date? > > thanks in advance Experts > > waiting for the reply, > > regards, > > Bala--~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
Bala
2007-Sep-27 07:48 UTC
Re: ORA-01858: a non-numeric character was found where a numeric was expected
Hi Liming, Thanks for the reply. I''ve tried like you suggest, i dont get ORA error, but the record fetch none. still its says empty Regards, Bala On Sep 27, 12:37 pm, lianliming <lianlim...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, Bala > > You have to use Class Date to wrap the your date_of_birth string, Try > following: > > date_of_birth=Date.new(1990,9,20) > > And execute your query statement again to see if it can get correct > result. > > Regards, > Liming > > On Sep 27, 2:05 pm, Bala <mbb...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi Experts, > > > When i execute this statement i got an error called ORA-01858 > > > mobile_number = ''1234567890'' > > email = "test...-vRmjhqX1jfVBDgjK7y7TUQ@public.gmane.org" > > secret_question = "whats your name" > > secret_answer = "crystal" > > date_of_birth = "20-SEP-90" > > > User.find(:first, :conditions => "mobile_number=''#{mobile_number}'' and > > email=''#{email}'' and date_of_birth=''#{date_of_birth}'' and > > secret_question=''#{secret_question}'' and > > secret_answer=''#{secret_answer}''") > > > ORA-01858: a non-numeric character was found where a numeric was > > expected > > > but when i execute as query in BE its working well, anyhow, i''ve tried > > using to_date(''#{date_of_birth}'', ''dd-mon-yy'') the query executes well > > with none record return, but i''ve the value of "20-SEP-90" on my db > > > anyway, i''ve a model Users with date_of_birth column with the type > > of :date > > > any suggestions? > > > is there any difference between rails date and oracle date? > > > thanks in advance Experts > > > waiting for the reply, > > > regards, > > > Bala--~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
Bala
2007-Sep-27 07:49 UTC
Re: ORA-01858: a non-numeric character was found where a numeric was expected
Hi Liming, Thanks for the reply. I''ve tried like you suggest, i dont get ORA error, but the record fetch none. still its says empty Regards, Bala On Sep 27, 12:37 pm, lianliming <lianlim...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, Bala > > You have to use Class Date to wrap the your date_of_birth string, Try > following: > > date_of_birth=Date.new(1990,9,20) > > And execute your query statement again to see if it can get correct > result. > > Regards, > Liming > > On Sep 27, 2:05 pm, Bala <mbb...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi Experts, > > > When i execute this statement i got an error called ORA-01858 > > > mobile_number = ''1234567890'' > > email = "test...-vRmjhqX1jfVBDgjK7y7TUQ@public.gmane.org" > > secret_question = "whats your name" > > secret_answer = "crystal" > > date_of_birth = "20-SEP-90" > > > User.find(:first, :conditions => "mobile_number=''#{mobile_number}'' and > > email=''#{email}'' and date_of_birth=''#{date_of_birth}'' and > > secret_question=''#{secret_question}'' and > > secret_answer=''#{secret_answer}''") > > > ORA-01858: a non-numeric character was found where a numeric was > > expected > > > but when i execute as query in BE its working well, anyhow, i''ve tried > > using to_date(''#{date_of_birth}'', ''dd-mon-yy'') the query executes well > > with none record return, but i''ve the value of "20-SEP-90" on my db > > > anyway, i''ve a model Users with date_of_birth column with the type > > of :date > > > any suggestions? > > > is there any difference between rails date and oracle date? > > > thanks in advance Experts > > > waiting for the reply, > > > regards, > > > Bala--~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
Bala
2007-Sep-27 07:53 UTC
Re: ORA-01858: a non-numeric character was found where a numeric was expected
Oh My Bad, so Sorry Liming, got it, i''ve typed wrong date. it works perfectly. Thanks a lot. regards, Bala On Sep 27, 12:37 pm, lianliming <lianlim...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, Bala > > You have to use Class Date to wrap the your date_of_birth string, Try > following: > > date_of_birth=Date.new(1990,9,20) > > And execute your query statement again to see if it can get correct > result. > > Regards, > Liming > > On Sep 27, 2:05 pm, Bala <mbb...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi Experts, > > > When i execute this statement i got an error called ORA-01858 > > > mobile_number = ''1234567890'' > > email = "test...-vRmjhqX1jfVBDgjK7y7TUQ@public.gmane.org" > > secret_question = "whats your name" > > secret_answer = "crystal" > > date_of_birth = "20-SEP-90" > > > User.find(:first, :conditions => "mobile_number=''#{mobile_number}'' and > > email=''#{email}'' and date_of_birth=''#{date_of_birth}'' and > > secret_question=''#{secret_question}'' and > > secret_answer=''#{secret_answer}''") > > > ORA-01858: a non-numeric character was found where a numeric was > > expected > > > but when i execute as query in BE its working well, anyhow, i''ve tried > > using to_date(''#{date_of_birth}'', ''dd-mon-yy'') the query executes well > > with none record return, but i''ve the value of "20-SEP-90" on my db > > > anyway, i''ve a model Users with date_of_birth column with the type > > of :date > > > any suggestions? > > > is there any difference between rails date and oracle date? > > > thanks in advance Experts > > > waiting for the reply, > > > regards, > > > Bala--~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
lianliming
2007-Sep-27 08:10 UTC
Re: ORA-01858: a non-numeric character was found where a numeric was expected
A little bit strange, how about only using date_of_birth condition like following? User.find(:first, :conditions => "date_of_birth=''#{date_of_birth}'' ") I just guess that maybe some other field doesn''t match. On Sep 27, 3:48 pm, Bala <mbb...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi Liming, > > Thanks for the reply. > > I''ve tried like you suggest, i dont get ORA error, but the record > fetch none. > still its says empty > > Regards, > > Bala > > On Sep 27, 12:37 pm, lianliming <lianlim...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi, Bala > > > You have to use Class Date to wrap the your date_of_birth string, Try > > following: > > > date_of_birth=Date.new(1990,9,20) > > > And execute your query statement again to see if it can get correct > > result. > > > Regards, > > Liming > > > On Sep 27, 2:05 pm, Bala <mbb...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hi Experts, > > > > When i execute this statement i got an error called ORA-01858 > > > > mobile_number = ''1234567890'' > > > email = "test...-vRmjhqX1jfVBDgjK7y7TUQ@public.gmane.org" > > > secret_question = "whats your name" > > > secret_answer = "crystal" > > > date_of_birth = "20-SEP-90" > > > > User.find(:first, :conditions => "mobile_number=''#{mobile_number}'' and > > > email=''#{email}'' and date_of_birth=''#{date_of_birth}'' and > > > secret_question=''#{secret_question}'' and > > > secret_answer=''#{secret_answer}''") > > > > ORA-01858: a non-numeric character was found where a numeric was > > > expected > > > > but when i execute as query in BE its working well, anyhow, i''ve tried > > > using to_date(''#{date_of_birth}'', ''dd-mon-yy'') the query executes well > > > with none record return, but i''ve the value of "20-SEP-90" on my db > > > > anyway, i''ve a model Users with date_of_birth column with the type > > > of :date > > > > any suggestions? > > > > is there any difference between rails date and oracle date? > > > > thanks in advance Experts > > > > waiting for the reply, > > > > regards, > > > > Bala--~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---