Solved

ORA-01002: fetch out of sequence

Posted on 2007-12-03
16
1,244 Views
Last Modified: 2012-05-05
I'm using TOAD and trying the export the results of a query but keep getting this error.
0
Comment
Question by:error_prone
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
16 Comments
 
LVL 28

Expert Comment

by:Naveen Kumar
ID: 20400690
i am not sure because i never got this error and never heard that toad can give this error.

may be exit/restart your toad and try.

Is this issue happening all the time only for a particular query ?
is this issue happening for all queries ?

Thanks
0
 
LVL 27

Expert Comment

by:sujith80
ID: 20400699
What is the query?
Which version of TOAD?
0
 

Author Comment

by:error_prone
ID: 20400704
It happens when I change the parameter to a certain month in the query.  A different parameter works fine, but it errors out on others.  Restarting TOAD does not help.
0
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 

Author Comment

by:error_prone
ID: 20400731
Version 8.1.7.  It's not the query because I get the error on even a simple select all.
0
 

Author Comment

by:error_prone
ID: 20400757
The error is occuring I think because of a bad date value.  I checked the View's code and tried running it and got a "date not valid for month specified".  Is there a way to weed out invalid dates in the where clause?
0
 
LVL 27

Expert Comment

by:sujith80
ID: 20400782
Are you trying to change the parameters before the completion of the query?
0
 

Author Comment

by:error_prone
ID: 20400785
Yes.
0
 

Author Comment

by:error_prone
ID: 20400791
Basically, my question is how do you resolve an invalid month error???
0
 
LVL 27

Expert Comment

by:sujith80
ID: 20400819
Changing the parameters before the completion of the query will lead to re-binding of values. It can lead to 1002 error.

>> how do you resolve an invalid month error??
What is the data type of your column? What is the expected format of data?
0
 

Author Comment

by:error_prone
ID: 20400834
It says Date.  It's being formatted in the view as 'MM/DD/YYYY'.
0
 

Author Comment

by:error_prone
ID: 20400835
So if certain records in this table are an invalid date then how do you resolve it?
0
 
LVL 27

Expert Comment

by:sujith80
ID: 20400856
>> if certain records in this table are an invalid date then how do you resolve it?
How can invalid date get into a date column?

Are you giving an invalid date in the where clause?
0
 

Author Comment

by:error_prone
ID: 20400864
Why not?  That's what it says here?  If not then why would it error out on certain parameters and not on others.  There's no date in the where clause.  All the parameters in the where clause are of type char.

http://www.experts-exchange.com/Database/Oracle/Q_22146001.html?sfQueryTermInfo=1+error+invalid+month
0
 
LVL 27

Accepted Solution

by:
sujith80 earned 500 total points
ID: 20401152
>> That's what it says here?
If you take a look at that link, they are applying a to_date function to two columns. That means the columns are "NOT OF TYPE DATE". And it has data not in the proper format.

TO_DATE (b.plannedstart_1, 'MM/DD/YYYY HH24:MI:SS') >=
                             TO_DATE (a.release_date, 'MM/DD/YYYY HH24:MI:SS')

If you are really looking for any help here. You should provide the query and the definition of the view.
0
 
LVL 1

Expert Comment

by:Computer101
ID: 20936926
Forced accept.

Computer101
Community Support Moderator
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows how to recover a database from a user managed backup

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question