SQL-J Language Reference
Page 49 of 121

SET RUNTIMESTATISTICS statement

You can turn RunTimeStatistics on or off for a connection with the SET RUNTIMESTATISTICS statement. By default, RunTimeStatistics are off. When RunTimeStatistics is on, Cloudscape creates an object that implements the COM.cloudscape.types.RunTimeStatistics interface for each statement executed within the connection (except for commit) until the attribute is turned off.

For statements that do not return rows, the object is created when all internal processing has completed before returning to the client program. For statements that return rows, the object is created when the first next() call returns 0 rows or a close(), whichever comes first.

You access the object created with the RUNTIMESTATISTICS() built-in function. See RUNTIMESTATISTICS().

Syntax

SET RUNTIMESTATISTICS { ON | OFF }

Example

-- establish a connection first
-- turns on RUNTIMESTATISTICS
SET RUNTIMESTATISTICS ON
-- for connection
-- execute complex query here
-- step through the result sets
-- access runtime statistics information here
SET RUNTIMESTATISTICS OFF