× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



No it doesn't.

The only thing it has is QUERY_TIME_LIMIT, which would seem to be what
the OP is asking for until you read the details.

"Specifies the maximum value that is checked against the _ESTIMATED_
number of elapsed seconds required to run a query. If the estimated
elapsed seconds is greater than this value, the query is _NOT
STARTED_. " (emphasis mine)

So this doesn't time out a running query, instead it prevent what it
_THINKS_ may be a long running query from even starting.

It's a good guess, but may not always be right.

That may be good enough for the OP or may not be.

I assume there's a reason IBM doesn't provide an actual run-time time
out, so I'm not sure if it's a good idea to try to roll your own.

Charles


On Mon, Mar 2, 2009 at 7:04 PM, Roger Harman <RHarman@xxxxxxxxxx> wrote:
QAQQINI has a parameter for elapsed seconds.  I'd assume the SQL status
code would indicate the timeout.

http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/rzajq/qryopt.htm#qryopt


tim2006@xxxxxxxxxxx 03/02/2009 3:38:00 PM >>>
- Show quoted text -
Tom,

Its possible that a query such as "select * from customer where custname
like %a_b%" is possible. The file has close to 1 million records. I was
wondering if I could put a time limit on the execution of the query. So,
say
after 30 seconds the query stops querying and returns a time allotted
has
expired or something like that.

I am using service calls to my iseries. These jobs are running in batch.


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Armbruster, Tom
Sent: Monday, March 02, 2009 5:45 PM
To: RPG programming on the IBM i / System i
Subject: RE: rpg sql timeout question

Good question, but a dangerous one at the same time.  For what reason
would you want to time out a request to the database?  There are only a
few reasons that SQL requests would time out:

1) CPU utilization is too high.
2) The query is written for updates on locked records.
3) The query is processing a large amount of data without the necessary
resources.
4) The query is not optimized.

Before concerning yourself with timeouts in native RPG, you may want to
ensure that you have optimized the data access methods.  Running SQL
interactively can be a slow process if the files and the query
statements are not optimized.  If the queries do not need to run
interactively, consider pushing them to a batch process.  If interactive
is required, optimize the queries as much as possible.

What is the situation you are referring to for which you want to
consider time outs?

Tom Armbruster

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of tim
Sent: Monday, March 02, 2009 11:57 AM
To: 'RPG programming on the IBM i / System i'
Subject: rpg sql timeout question

Is there a way to have a possibly long running sql performed  in an
SQLRPGLE
program, to time out after running for a certain amount of time?





--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.