PC Review


Reply
Thread Tools Rate Thread

.net oracle managed provider date issue

 
 
tribalstorm
Guest
Posts: n/a
 
      13th May 2008
Hi,

The following query runs fine in Oracle SQL Developer, it also runs fine
using the .net oracle managed provider on my local dev machine. However, it
errors out when I run it on our web server with the following error message:

ORA-01830: date format picture ends before converting entire input string

I've ran into a similar issue about dates a few weeks ago...and tracked it
down to that the web server seemed to somehow utilize a slightly different
date format than my dev machine, I believe it had to do with if a zero was
put in front of a date--ie.e 5/13/08 vs 05/13/08.

I thought this was weird, but worked around it with my code...now it's
happening again, and I'd like to actually understand and fix what is really
going on.

I thought maybe there were different versions of the driver on my dev box vs
web server, but I looked at object browser for system.data.oracle client on
both boxes and they say 2.0.50727...

Here is the sql (is the same is generated locally and on web server)

Select to_char(as_of_date,'mm/yyyy') as dt, round(avg(rate),4) as
rate,upper(index_name) as scenarioname
FROM CMRG_DATA.VW_GETDATA_MARKET_RATES where upper(index_name) like
'PMMS30W' AND (AS_OF_DATE
BETWEEN TO_DATE('01/01/2004,01/01/2004','MM/DD/YYYY') AND
TO_DATE('01/01/2005,01/01/2005','MM/DD/YYYY'))
group by to_char(AS_OF_DATE,'mm/yyyy'),index_name

Thanks anyone for your help!!!


 
Reply With Quote
 
 
 
 
Kerry Moorman
Guest
Posts: n/a
 
      13th May 2008
tribalstorm,

Since the query works in other environments your to_date function must be
valid.

But all of my documentation says the function takes 2 arguments: a date and
a format string. Yet you supply the date argument as 2 dates separated with a
comma:

'01/01/2005,01/01/2005'

How does that work?

Kerry Moorman



"tribalstorm" wrote:

> Hi,
>
> The following query runs fine in Oracle SQL Developer, it also runs fine
> using the .net oracle managed provider on my local dev machine. However, it
> errors out when I run it on our web server with the following error message:
>
> ORA-01830: date format picture ends before converting entire input string
>
> I've ran into a similar issue about dates a few weeks ago...and tracked it
> down to that the web server seemed to somehow utilize a slightly different
> date format than my dev machine, I believe it had to do with if a zero was
> put in front of a date--ie.e 5/13/08 vs 05/13/08.
>
> I thought this was weird, but worked around it with my code...now it's
> happening again, and I'd like to actually understand and fix what is really
> going on.
>
> I thought maybe there were different versions of the driver on my dev box vs
> web server, but I looked at object browser for system.data.oracle client on
> both boxes and they say 2.0.50727...
>
> Here is the sql (is the same is generated locally and on web server)
>
> Select to_char(as_of_date,'mm/yyyy') as dt, round(avg(rate),4) as
> rate,upper(index_name) as scenarioname
> FROM CMRG_DATA.VW_GETDATA_MARKET_RATES where upper(index_name) like
> 'PMMS30W' AND (AS_OF_DATE
> BETWEEN TO_DATE('01/01/2004,01/01/2004','MM/DD/YYYY') AND
> TO_DATE('01/01/2005,01/01/2005','MM/DD/YYYY'))
> group by to_char(AS_OF_DATE,'mm/yyyy'),index_name
>
> Thanks anyone for your help!!!
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Issue with Managed Oracle Provider in .NET Pat Microsoft ADO .NET 3 15th Nov 2004 05:13 PM
Oracle .Net Managed Provider Chris Microsoft Dot NET Framework 1 17th Sep 2003 11:26 PM
.Net Managed Provider for Oracle 1.1 Ramesh Microsoft C# .NET 4 4th Sep 2003 11:36 AM
Error Message with Oracle .NET Managed Provider Robert Microsoft ADO .NET 3 20th Aug 2003 08:41 PM
Re: .NET Managed Provider for Oracle 1.1 Dino Chiesa [MSFT] Microsoft Dot NET Framework 1 20th Aug 2003 07:23 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:18 PM.