5 pts.
 How do I disable the query timeout property?
I'm calling a stored procedure on the AS/400 from Visual Basic .Net. When the stored procedure executes, I get the SQL0666 message (query exceeds specified time limit or storage limit). The query timeout property on the box is set to *NOMAX and I've Reorg'd the files too. The message appears to be coming from the PC side and not the AS/400 side. I'm using the UDB DB2 data provider that comes with iSeries Access for Windows V5R3 and later. Does anyone know how to get around this? Thanks.

Software/Hardware used:
ASKED: January 12, 2009  3:33 PM
UPDATED: October 23, 2009  8:06 PM

Answer Wiki:
Hi, I'd start by checking the system values on the AS/400 :- DSPSYSVAL SYSVAL(QQRYTIMLMT) Regards, Martin Gilbert. ------------------------------------------------------------ Did you check http://www.itjungle.com/fhg/fhg071305-story03.html Phil
Last Wiki Answer Submitted:  October 13, 2009  7:46 pm  by  philpl1jb   44,180 pts.
All Answer Wiki Contributors:  philpl1jb   44,180 pts. , Gilly400   23,625 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Here’s a discussion on the query time out limits.
http://www.itjungle.com/fhg/fhg071305-story03.html

The other possibility is in the ODBC/JDBC driver settings.
Phil

 44,180 pts.

 

I am getting the same error. I’m on V5R4M0. System value (QQRYTIMLMT) set to *NOMAX.

 645 pts.

 

If it appears to be on the PC side, you should add .NET tags to the question so the gurus over there can help you too.

 7,185 pts.

 

When this happens, you need to set the iDB2Command CommandTimeout property to a specific value. I think the default is 30 seconds. Setting it to 0 is effectively *NOMAX.

Here is a sample:

iDB2Connection _conn = new iDB2Connection(ConnectionString,
IpAddress, User, Password);
iDB2Command = _conn.CreateCommand();
_cmd.CommandTimeout = 0;
_cmd.CommandType = CommandType.StoredProcedure;
// Add Parameters here
_cmd.Parameters.Add(name, type, size.Value);
_cmd.Parameters[name].Value = value;
_cmd.Parameters[name].Direction = direction;

_cmd.Prepare();
var q = _cmd.ExecuteNonQuery();

I would also recommend upgrading to the V5R4 .Net Provider SP1, it will stop that nagging ObjectDisposedException from being thrown at the end of the .Net program execution.


Joel Cochran
http://www.developingfor.net

 10 pts.