Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to capture TALK output
Message
 
 
To
30/11/2000 12:58:06
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00447505
Message ID:
00447586
Views:
17
>If SET TALK ON during the execution of an SQL statement, the system will report:
>"xxx records selected in xx seconds". Is there a way to capture this to a variable so I can report this information in a different way ?
>
>Thanks
>Bruce Covey

You can use this:
          if ojc.viewsql  && analyze mode is turned on
               =sys(3054,11)  && Turn on rushmore opt results to write to screen for now.
* -- NSL 2/16/00 add code to pipe rushmore optimization output to a file and eventually memo field.
               lcOldSafety=set('safety')
               set safety off  && So that will write to the txt file w/o query
               set alternate to rushtxt.txt
               set alternate on
          endif
* -- NL 11/19/99 End
* -- NSL 2/16/00 add more code to log the sql time.
          local qStartTime,qEndTime,qElapTimeVal
          qStartTime = seconds()
* -- NSL 2/16/00
          set talk on                                   && yields VFP thermometer on slow SELECT - SQL queries


* invoke output generation - multi-line, macro-expanded SELECT statement
          &selectcmd1 ;
               &selectcmd2 ;
               &nextdest

* -- NL 11/19/99 start
          tmpreccount=reccount()  && NSL 2/17/00 Put in so could record in perf log, It really is redundant and should be removed
          if ojc.viewsql  && analyze mode is turned on
               =sys(3054,0)  && Turn rusmore results back off.
* -- NSL 2/16/00 add code to pipe rushmore optimization output to a file and eventually memo field.
               set alternate to
               set alternate off
               if lcOldSafety='ON'
                    set safety on
               endif
               lnOldSelect=select()
               select viewsql  && Assume we are still on the correct record - careful in m/u, but then this is for debugging.
               append memo txtrush from rushtxt.txt
               select (lnOldSelect)
          endif
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform