[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

06/17/2003 at 12:32PM PDT, ID: 20651328
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.0

DB2 Query Execution Estimate

Asked by wfinn in DB2 Database

Tags: database, db2, query

I am executing a query against a DB2 database on an AS400 using VB.  I create a connection using ADO, execute the query, and bring back the result into a recordset.  The problem I am having is with the connectiontimeout parameter of ADO.  The default is 30 seconds.  Most queries I have take only a couple of seconds to execute.  Once in a while I get a query that takes longer, but certainly not longer than 30 seconds.  The problem is that before the query is executed, DB2 estimates how long it will take to execute.  If it thinks it will take longer than the value specified in the connectiontimeout, it will not even attempt to execute the query.  This is a problem as the reality is the query only takes a couple of seconds to execute, but DB2 in some cases comes back with estimates of 20 minutes or longer, and does not execute the query.

What I would really like to have happen is for the query to execute, and if it goes longer than the timeout, have it fail at that point.  I do not want to set an unreasably long timeout, or let it execute forever.  

So my question is, does anyone know how to turn the estimator off and keep the commandtimeout reasonable.

Here is an example of the code that is used to execute the query:

    Dim objRS           As ADODB.Recordset
    Dim objCmd          As ADODB.Command

    Set objCmd = New ADODB.Command
    With objCmd
        Set .ActiveConnection = objCTIconn  ' This is the Connection
        .CommandText = strQuery     ' This is the query being execued
        .CommandTimeout = 30         ' Timeout of 30 seconds.  This is also default.
        .CommandType = adCmdText
        Set objRS = .Execute
    End With
    Set GetCtiDATA = objRS
    Exit Function


Thanks.
[+][-]06/18/03 05:43 AM, ID: 8748624

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/18/03 11:37 AM, ID: 8751518

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06/19/03 02:09 AM, ID: 8756155

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/19/03 01:16 PM, ID: 8761251

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: DB2 Database
Tags: database, db2, query
Sign Up Now!
Solution Provided By: BigSchmuh
Participating Experts: 2
Solution Grade: A
 
 
[+][-]11/12/04 01:01 PM, ID: 12570188

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]11/19/04 12:07 PM, ID: 12629422

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-91