Advertisement
Guest User

SQL Query Benchmark

a guest
Sep 19th, 2013
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. d stopwatch ds qualified
  2. d start z
  3. d end z
  4. d seconds 10u 0
  5.  
  6. d i s 10i 0 inz(0)
  7.  
  8. d rec e ds extname(orders)
  9.  
  10. /free
  11.  
  12. exec sql set option commit = *none;
  13.  
  14. clear sqlca;
  15.  
  16. stopwatch.start = %timestamp();
  17.  
  18. for i = 1 to 1000;
  19. exec sql select * into :rec from orders
  20. where orderno = :i;
  21. endfor;
  22.  
  23. stopwatch.end = %timestamp();
  24. stopwatch.seconds = %diff(stopwatch.end:stopwatch.start:*ms);
  25.  
  26. dsply %char(stopwatch.seconds);
  27.  
  28. *inlr = *on;
  29.  
  30. /end-free
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement