Solved

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

Posted on 2009-05-15
6
2,945 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
  • 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
Technology Partners: 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!

 

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
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.

679 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