Solved

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

Posted on 2009-05-15
6
2,797 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 34

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 34

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 34

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 to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

In a recent article here at Experts Exchange (http://www.experts-exchange.com/articles/18880/PaperPort-14-in-Windows-10-A-First-Look.html), I discussed my nine-month sandbox testing of the Windows 10 Technical Preview, specifically with respect to r…
#Citrix #POC #XenDesktop #vCenter #VMware #ESX
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

705 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now