Hi all,
is there a VST that tells which program is running? and if it exists, can I know which tables this program is using?
Thanks,
Marco Aurelio
Not by default. But if you enable database client request statement caching for a user (or server, or DB) then the client sends all or part of its ABL call stack to the DB when it accesses the DB. That data can be read from an array in _Connect.
Per-user table and index CRUD stats can be read from _UserTableStat and _UserIndexStat, provided you have appropriate values for -basetable, -baseindex, -tablerangesize, and -indexrangesize.
Info on using the database request statement caching feature (10.1C+):
http://download.psdn.com/media/revolution_2011/oe11/OE1111.wmv
nice vídeo. thanks
Just to avoid a common misconception:
Database statement cache will *not* accurately report exactly what the client is doing. You get the details on the last database accessing statement that was executed only. No more, no less.
So if for example you've got code that FILLs a prodataset and then does some processing on the dataset that pulls into an infinite loop for some reason, the Database statement cache will only point to the FILL operation since that's the last time the code accessed the database.
Likewise, if the code uses multiple statements to read different tables - you get only one of them, not all of them.
See also: knowledgebase.progress.com/.../P150383