473,625 Members | 2,717 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ORA-1866 The datetime class is invalid error

Hello all
Thank you all in advance. I am completely at a loss here with this error. I am developing a simple interface that will allow a user to enter,execute and view results from a SQL statement to our oracle database. I have found that I can not query more than a single day at a time when using a date > 12/31/2002 as my where clause
For example

select * from tclaim where (process_date >= to_date('02/01/04', 'mm/dd/yy')) and (process_date < to_date('02/05/04','mm/dd/yy')

select * from tclaim where process_date >= '01-FEB-2004' and process_date < '05-FEB-2004

Neither one of the above statements will execute unless I make the year less than 2003 in my dates or only ask to return one day. I have poured over several sites and articles without so much as a clue why this is happening. Any help would be greatly appreciated as I am desparately trying to showcase VB.NET to my employers and not being able to query data using a date field in this calendar year is sure going to make this a hard sell

Thank you!!
Jul 21 '05 #1
4 4377
Hi Malcolm,

You are talking about Oracle problem that has nothing to do with VB.NET.
As a better approach you might use parametrised query.
Something like:
select * from tclaim where (process_date >= :fromDate) and (process_date <
:toDate)
cmd.Parameters. Add(":fromDate" , OracleType.Date Time).Value = fromDate '
insert your date here
cmd.Parameters. Add(":toDate", OracleType.Date Time).Value = toDate ' insert
your date here

--
Miha Markic [MVP C#] - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com

"Malcolm Diaz" <md***@planvist a.com> wrote in message
news:AA******** *************** ***********@mic rosoft.com...
Hello all,
Thank you all in advance. I am completely at a loss here with this error. I am developing a simple interface that will allow a user to
enter,execute and view results from a SQL statement to our oracle database.
I have found that I can not query more than a single day at a time when
using a date > 12/31/2002 as my where clause. For example;

select * from tclaim where (process_date >= to_date('02/01/04', 'mm/dd/yy')) and (process_date < to_date('02/05/04','mm/dd/yy'))
select * from tclaim where process_date >= '01-FEB-2004' and process_date < '05-FEB-2004'
Neither one of the above statements will execute unless I make the year less than 2003 in my dates or only ask to return one day. I have poured over
several sites and articles without so much as a clue why this is happening.
Any help would be greatly appreciated as I am desparately trying to showcase
VB.NET to my employers and not being able to query data using a date field
in this calendar year is sure going to make this a hard sell!
Thank you!!

Jul 21 '05 #2
Hello,

Thanks for your post. As I understand, the problem you are facing is that a
SQL statement does not work properly when using a date > 12/31/2002. Please
correct me if there is any misunderstandin g.

1. Make sure that there are several rows with date > 12/31/2002 in your
table.

2. To narrow down the problem, I suggest that you can execute the SQL
statement in Oracle SQL Plus window and see if it works.

2. In addition, you can also try other date format in SQL statement. For
example:

select * from tclaim where process_date >= '2004-02-01' and process_date <
'2005-02-01'

I am standing by for your response.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Jul 21 '05 #3
Actually, yes it's an error message returned by Oracle but both example SQL statements I provided earlier will execute flawlessly in any enviornment BUT my vb.net code. I've tried both statements in SQL*PLUS, SQL Worksheet, and Tools For Oracle(aka Tora) with no problems at all. Only when using VB.NET does it blow up on me. All this leads me to believe that it is VB.NET that is experiencing a problem. The parametrised query is a good idea but makes no difference....a s long as I insist on asking for more than a single days worth of data in 2003 or 2004 it will not execute. Can anyone at all point me in a different direction
Again I thank you all in advance for what advice you may send me and to those who have replied I am in your debt! Thank you

----- Miha Markic [MVP C#] wrote: ----

Hi Malcolm

You are talking about Oracle problem that has nothing to do with VB.NET
As a better approach you might use parametrised query
Something like
select * from tclaim where (process_date >= :fromDate) and (process_date
:toDate
cmd.Parameters. Add(":fromDate" , OracleType.Date Time).Value = fromDate
insert your date her
cmd.Parameters. Add(":toDate", OracleType.Date Time).Value = toDate ' inser
your date her

--
Miha Markic [MVP C#] - RightHand .NET consulting & software developmen
miha at rthand co
www.rthand.co

"Malcolm Diaz" <md***@planvist a.com> wrote in messag
news:AA******** *************** ***********@mic rosoft.com..
Hello all
Thank you all in advance. I am completely at a loss here with thi error. I am developing a simple interface that will allow a user t
enter,execute and view results from a SQL statement to our oracle database
I have found that I can not query more than a single day at a time whe
using a date > 12/31/2002 as my where clause For example
select * from tclaim where (process_date >= to_date('02/01/04' 'mm/dd/yy')) and (process_date < to_date('02/05/04','mm/dd/yy') select * from tclaim where process_date >= '01-FEB-2004' and process_dat < '05-FEB-2004 Neither one of the above statements will execute unless I make the yea less than 2003 in my dates or only ask to return one day. I have poured ove
several sites and articles without so much as a clue why this is happening
Any help would be greatly appreciated as I am desparately trying to showcas
VB.NET to my employers and not being able to query data using a date fiel
in this calendar year is sure going to make this a hard sell Thank you!


Jul 21 '05 #4
I've tried both statements in SQL*PLUS, SQL Worksheet, and Tools For Oracle(aka Tora) with no problems at all. Only when using VB.NET does it blow up on me. All this leads me to believe that it is VB.NET that is experiencing a problem. I also played with using several different date formats in my efforts but to no avail. Like before I can get the query to execute perfectly anywhere but my vb.net enviornment. This is extremely frustrating as this simple problem is causing me to lose my fight for VB.NET in the work place. I can't justify reccommending this product as long as a simple SQL statment is going to cause so much problems. At this point I would much rather have someone more versed in the language find a silly or even an out right stupid mistake in my code as the problem than to have to tell my employer that VB.net could handle a simple query. I refuse to believe it can't be done

Again I thank you all for any help at all.
Jul 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3939
by: Ping | last post by:
Where can i find the initialization file to change some parameters? This file used to be init<sid>.ora in previous versions of oracle. Oracle 9.2 on xp is in question. Thanks in advance Ping
1
5146
by: Adam Ruth | last post by:
I'm using OCI on Mac OS X and I've run into a strange problem with my TNSNAMES.ORA file. My TNSNAMES.ORA file has one entry INV4II and it works fine. However, it will only work if that is the name of the entry. If I use any other name for that entry I get the dreaded ORA-12154. For example: TNSNAMES.ORA -> INV4II Application -> INV4II :: works fine TNSNAMES.ORA -> INV4DEV Application -> INV4DEV :: ORA-12154 TNSNAMES.ORA -> INV4DEV...
6
4685
by: bdj | last post by:
Hello! I have at set of tnsnames.ora. I wich to make an union, e.g. a single file of it. How can I do that easy? Greetings Bjørn
1
14884
by: Paul Green | last post by:
What might cause the following behavior? We have a set of front-end programs accessing an Oracle database on the server. Things work fine on our older computers and mostly OK on our new computers - except one particular program, after being used for a few minutes gives errors like ORA-12571, ORA-03114. This suggests the network is disconnected, but tnsping shows the Oracle DB is still there, and the other programs in the suite still work.
5
17098
by: jstmehr4u3 | last post by:
I just installed ODP.net 10.2.02 on my local machine (Windows XP Pro) running IIS. I have created a sample webservice in VS2003, connecting to localhost. I am getting: Oracle.DataAccess.Client.OracleException ORA-12154: TNS:could not resolve the connect identifier specified at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src,...
2
43550
by: Dwie | last post by:
Dear All, I'm a new in Oracle DB. I'm using Windows 2000 as server and Windows XP as client. I installed Oracle Enterprise on server and Oracle 8.1 on clients. I have some client with 2 different IP address, 172.16.xx.xx and 192.168.xxx.xx whices I want to connect to the server DB. How can I set the Listener.ora & Tnsnames.ora so all clients could connect to server. Right now I can connect just only one IP and the other IP is offline, but...
7
8674
by: lrg | last post by:
I'm writing an application in ASP.NET using C# for code behind and i'm also using oracle 10g. I thought when i retrieve data from the DB first tnsnames.ora is referred. But my experience is that server name given in web.config is directly connected whether or not entry is present in tnsnames.ora. Then why do we need a tnsnames.ora?
5
17020
by: Nitvar | last post by:
When i am trying to connect to oracle it is giving me these two errors ORA-12224: TNS:no listener ORA-01034: ORACLE not available I am new to oracle ,plz help I am using solaris 5.6 and oracle 8.0.5 version I am posting my listener.ora and Tnsname
1
2147
by: bacterium | last post by:
Hi, Is there any way to solve the question :'ORA-12154: TNS:could not resolve service name' ,I import database in Oracle , but I can not logon into the database , while login through the SQL PLUS, it notes 'ORA-12154: TNS:could not resolve service name', I configured at net8s configure assistant , at the end it notes : ORA-12514: TNS:listener could not resolve SERVICE_NAME given in connect descriptor. but on the file tnsnames.ora : KANKYO = ...
1
3167
by: michael ngong | last post by:
michael.john@gmx.at (Michael John) wrote in message news:<90cc4edd.0306230900.28075193@posting.google.com>... MIchael I you stated the OS and platform that could make it easier to address your issue Michael Tubuo Ngong
0
8189
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8635
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8354
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7182
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4089
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2621
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1802
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1499
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.