To obtain information about the last SQL statement that each session executed, issue the onstat -g sql command with the appropriate session ID. Figure 88 shows sample output for this option using the same session ID obtained from the onstat -u sample in Figure 87.
onstat -g sql 15
Sess SQL Current Iso Lock SQL ISAM F.E.
Id Stmt type Database Lvl Mode ERR ERR Vers
15 SELECT vjp_stores CR Not Wait 0 0 9.03
Current statement name : slctcur
Current SQL statement :
select l.customer_num, l.lname, l.company, l.phone, r.call_dtime,
r.call_descr from customer l, vjp_stores@gilroy:cust_calls r where
l.customer_num = r.customer_num
Last parsed SQL statement :
select l.customer_num, l.lname, l.company, l.phone, r.call_dtime,
r.call_descr from customer l, vjp_stores@gilroy:cust_calls r where
l.customer_num = r.customer_num