How can I query my open edge database for the tables being queried by the odbc connections at any given point of time?
Yes, number of connections can be measure using proshut DBname -C list. but which tables are being queried by ODBC connections?
You might be able to look at the _connect table and identify the ODBC connections. Get their user number and then look in the _usertablestats.
Regarding [mention:1d4289f2141941a1bfd667a1d5bc679e:e9ed411860ed4f2ba0265705b8793d05]'s suggestion: you need to be certain to correctly assign the DB startup parameters -tablerangesize and -indexrangesize otherwise the broker only tracks statistics for the first 50 tables and indexes.
One caveat: _UserTableStat and _UserIndexStat info only live for as long as the user is connected. If an ODBC connection connects, does a quick query, then disconnects, then you're timing will have to be perfect to catch his tablestat activity.
Another option is to enable SQL logging. Look in the SQL Reference PDF for SET PRO_CONNECT LOG and SET PRO_SERVER LOG.
[mention:dc2ff39fa15940708b78017f1194db6a:e9ed411860ed4f2ba0265705b8793d05] is too...ahem...busy...to login himself and tell you that the client statement cache will show the most recently executed SQL statement. Seems I'm his secretary this morning.
Careful though: CSC is not something you want to turn on and leave on in production. There is a cost associated with CSC.