Solved

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

Posted on 2009-05-15
6
3,022 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
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

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…
Sometimes a user will call me frantically, explaining that something has gone wrong and they have tried everything (read - they have messed it up more and now need someone to clean up) and it still does no good, can I help them?!  Usually the standa…
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.

688 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