23.10.2012 Views

Openedge Data Management: SQL Reference - Product ...

Openedge Data Management: SQL Reference - Product ...

Openedge Data Management: SQL Reference - Product ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

• Query statement execution<br />

• Query fetch<br />

SET PRO_SERVER QUERY_TIMEOUT<br />

• The value specified by n applies to all subsequent protocol messages of these types until<br />

the timeout value is cleared. This may be accomplished simply by specifying a value of 0<br />

on subsequent execution of the statement.<br />

Example This example sets the query timeout to 30 seconds:<br />

SET PRO_SERVER QUERY_TIMEOUT<br />

Syntax<br />

Defines the maximum number of seconds during which a query should execute for the current<br />

<strong>SQL</strong> Server connection.<br />

n<br />

Statement stmt = connection.createStatement();<br />

String MySetQueryTimeout;<br />

String MyClearQueryTimeout;<br />

MySetTimeout = “SET PRO_CONNECT QUERY_TIMEOUT 30”;<br />

MyClearTimeout = “SET PRO_CONNECT QUERY_TIMEOUT 0”;<br />

// Set <strong>SQL</strong> Server timeout for query execute and fetch<br />

stmt.executeUpdate( MySetQueryTimeout );<br />

// Add code here to perform queries<br />

// Clear <strong>SQL</strong> Server timeout for query execute and fetch<br />

stmt.executeUpdate( MyClearQueryTimeout );<br />

SET PRO_SERVER QUERY_TIMEOUT n ;<br />

Indicates the maximum number of seconds during which a query should execute before it<br />

is automatically cancelled by the <strong>SQL</strong> server. Setting an n value of 0 disables a previously<br />

set query timeout.<br />

Notes • Execution of this command is restriced to DBAs. Any value set with this command is in<br />

effect for the duration that the database is up and running.<br />

• Should a query timeout value be set for an individual connection via the command SET<br />

PRO_CONNECT QUERY_TIMEOUT the lower of the timeout values for the connection<br />

and the server takes precedence.<br />

This example sets the query timeout to 30 seconds:<br />

59

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!