Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to pause after a query?

Status
Not open for further replies.

CapsuleCorpJX

IS-IT--Management
Jun 23, 2004
70
US
I want a particular query to run 1000 times, with a pause (100 milliseconds) after each run. This is for performance testing.

Anyway, can I do this inside a stored procedure (i.e. use a loop and call some sleep command) or inside a Unix shell script using BTEQ?
 
Hi,
100 MILLISECONDS is tough. The granularity on the UNIX SLEEP command is a second.

You might be able to build a stored procedure which was a simple while loop

while ( x < 1000 )
x ++;

or whetever the appropriate TDSP syntax would be Set the loop value to something that approximates 100 milliseconds.

If you are on 5.1 you could write a UDF in 'C' so you could call sleep directly from your program.


Typically you loop a query in BTEQ by executing

.repeat 1000
my sql here

or

my sql here
= 999

you could build your script like.....

my sql here
.os sleep 1

my sql here
.os sleep 1

.
.
.

1000 times. or

my sql here
call myloop_sp

my sql here
call myloop_sp

.
.
.

1000 times.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top