Solved

SQL query exceeds time limit or storate limit DB2.Net Data Provider

Posted on 2009-05-15
6
2,987 Views
Last Modified: 2013-12-06
I've had an web app running for about a year now.   It's a C#, ASP.Net application that using the DB2 .NET data procvider to iSeries.  

Starting yesterday, the following exception is being thrown:

SQL0666 SQL query exceeds specified time limit or storage limit.

When this statement is ran:
Select MenuAccounting.*, (CashAmount + ChargeAmount) as TotalSales From MenuAccounting Where OrderDate >= '5/15/2009'  and OrderDate <= '5/15/2009'  Order by OrderDate

The statement should only return 1 row of data base.  It is ran over a view that has 220 records in it.  

I can run the statement fine as a script through IBM System navigator.  The system query timelimit is set to *NoMax.  

Doesn't anyone know what the problem could be?
0
Comment
Question by:weimha
[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
  • 3
  • 2
6 Comments
 
LVL 35

Expert Comment

by:Gary Patterson
ID: 24400052
Setting SYSVAL(QQRYTIMLMT) to *NOMAX may not be enough.  Change the timeout in the DSN (or connection string, or timeout property of the object), too:

http://www.itjungle.com/fhg/fhg071305-story03.html

- Gary Patterson



0
 
LVL 35

Expert Comment

by:Gary Patterson
ID: 24400084
Oh, and as for "why did this happen now".  The best answer I can give you is "Someone probably changed something somewhere."  AS/400 upgrade, PTFs applied, MS automatic update, or the underlying physical file (not the view) may have grown large, and the query engine is generating a bad estimate of runtime.  If extended SQL support is being used, the SQLPKG object on the AS/400 could have possibly been deleted.

The DB2 query optimizer may not choose to look at the view that you specified when it does it's estimates.

- Gary Patterson
0
 
LVL 35

Accepted Solution

by:
Gary Patterson earned 500 total points
ID: 24400123
In ADO:

Dim conn As New ADODB.Connection
Dim cmd As New ADODB.Command
Dim rs As ADODB.Recordset

conn.Open "your connection string goes here"
conn.CommandTimeout = 0

Set rs = conn.Execute("your query goes here")

- Gary Patterson
0
How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

 

Author Comment

by:weimha
ID: 24411925
I changed the command timeout to = 0 in the connection string, but I still get the error.
0
 

Author Comment

by:weimha
ID: 24425722
I was using a data adapter and figured out how to set the command timeout on it.  It worked,.  Thanks
0
 

Expert Comment

by:matt2door
ID: 33099567
Weimha - This is an old post, but I am using the data adapter and having the same problem.  Where did you set the command timeout?
Thanks,
Matt
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

734 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