469,923 Members | 1,586 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,923 developers. It's quick & easy.

Time a SQL statement

Hi,

How to time the duration of a SQL statement issued in DB2 command CLP?
Aaron

Jan 2 '07 #1
3 1534
aa******@yahoo.com.au wrote:
Hi,

How to time the duration of a SQL statement issued in DB2 command CLP?
Just a few ideas: You can either use the "time" command (may be operating
system specific), a snapshot, or rely on "db2batch" instead of "db2".

--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
Jan 2 '07 #2
Ian
Knut Stolze wrote:
aa******@yahoo.com.au wrote:
>Hi,

How to time the duration of a SQL statement issued in DB2 command CLP?

Just a few ideas: You can either use the "time" command (may be operating
system specific), a snapshot, or rely on "db2batch" instead of "db2".
And the old standby, "values (current timestamp)" before and after the
SQL statement.

Jan 2 '07 #3
I've had to do this on many different systems. My preferred solution is
a small REXX routine I wrote that takes the command to be executed as a
parameter and sandwiches it between two "get current time" commands. A
simple calculation gives me the duration. This is doable on every
operating system I've used, from DOS (on a PC) to the largest
mainframes. If REXX isn't available for your system, a script file or
some other supported scripting language will be available and should
provide the facilities you need.

Phil Sherman
aa******@yahoo.com.au wrote:
Hi,

How to time the duration of a SQL statement issued in DB2 command CLP?
Aaron
Jan 2 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Radioactive Man | last post: by
13 posts views Thread by Adam Blair | last post: by
4 posts views Thread by =?Utf-8?B?VGhlTWFkSGF0dGVy?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.