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
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
I am getting the same error. I’m on V5R4M0. System value (QQRYTIMLMT) set to *NOMAX.
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.
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