• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3236
  • Last Modified:

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

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
weimha
Asked:
weimha
  • 3
  • 2
1 Solution
 
Gary PattersonVP Technology / Senior Consultant Commented:
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
 
Gary PattersonVP Technology / Senior Consultant Commented:
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
 
Gary PattersonVP Technology / Senior Consultant Commented:
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
weimhaAuthor Commented:
I changed the command timeout to = 0 in the connection string, but I still get the error.
0
 
weimhaAuthor Commented:
I was using a data adapter and figured out how to set the command timeout on it.  It worked,.  Thanks
0
 
matt2doorCommented:
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

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now