(Not sure where this sysopendb query comes from or why it's being shown ... it probably is irrelevant here.)
It's not the INSERT statement that holding those locks, but the surrounding transaction. The INSERT, if it was the last statement in this session might still be visible as 'last parsed SQL statement', but there could as well have been N other statements running since that particular INSERT.
What you're typically interested in is which session is holding a given lock, and then maybe whether the lock originates from an INSERT, UPDATE or DELETE. The latter you could see from 'onstat -k' -> DML column.
------------------------------
Andreas Legner
------------------------------
Original Message:
Sent: Tue November 22, 2022 04:11 AM
From: Alexander Ivanov
Subject: How to see what querry blocked table?
Hello.
I have Informix 14.10.
I started the session and checked DBINFO('sessionid').
Then in that session i ran:
BEGIN;INSERT INTO ttt VALUES(1);
In another session i ran
SELECT * FROM syslocks;
and see 2 locks on my table and the owner is my sessionid.
I was expecting that when i run onstat -g sql sessionid i will see my Insert command, but I see
SELECT ODB_DBName FROM SysMaster:"informix".SysOpenDB WHERE ODB_SessionID = DBINFO('sessionid') AND ODB_IsCurrent = 'Y'
How i can see the real querry that is locking my table?
------------------------------
Alexander Ivanov
------------------------------
#Informix