Code: Select all
select
b.mon$user,
c.mon$sql_text,
a.mon$transaction_id,
a.mon$attachment_id,
a.mon$state,
a.mon$timestamp,
a.mon$top_transaction,
a.mon$oldest_transaction,
a.mon$oldest_active,
a.mon$isolation_mode,
a.mon$lock_timeout,
a.mon$read_only,
a.mon$auto_commit,
a.mon$auto_undo,
a.mon$stat_id,
case a.mon$isolation_mode
when 0 then 'Consistency'
when 1 then 'Concurrency'
when 2 then 'Read Committed Record Version'
when 3 then 'Read Committed'
else 'Unknown'
end as Desc_Isolation,
case a.MON$LOCK_TIMEOUT
when -1 then 'Infinite Wait'
when 0 then 'No wait'
else 'Timeout ' || cast(MON$LOCK_TIMEOUT as varchar (20))
end as Desc_TimeOut
from mon$transactions a
join MON$ATTACHMENTS b on b.MON$ATTACHMENT_ID = a.MON$ATTACHMENT_ID
join MON$STATEMENTS c on c.MON$ATTACHMENT_ID = a.MON$ATTACHMENT_ID
where (a.mon$attachment_id <> current_connection)
order by 1
Code: Select all
SELECT a.RDB$RELATION_NAME, a.RDB$FIELD_NAME, a.RDB$FIELD_POSITION, a.RDB$NULL_FLAG, a.RDB$DEFAULT_VALUE, b. RDB$FIELD_LENGTH, b.RDB$FIELD_SCALE, c.RDB$_NAME, b.RDB$FIELD_, b.RDB$FIELD_SUB_, b.RDB$DESCRIPTION, b.RDB$CHARACTER_LENGTH, b.RDB$FIELD_PRECISION, a.RDB$DEFAULT_SOURCE, b.RDB$DEFAULT_SOURCE as RDB$DEFAULT_SOURCE_DOMAIN,b.RDB$COMPUTED_SOURCE as RDB$COMPUTED_SOURCE , b.RDB$CHARACTER_SET_ID FROM RDB$RELATION_FIELDS a JOIN RDB$FIELDS b ON (b.RDB$FIELD_NAME = a.RDB$FIELD_SOURCE) LEFT JOIN RDB$ c ON (b.RDB$FIELD_ = c.RDB$ and c.RDB$FIELD_NAME = 'RDB$FIELD_) WHERE 1=1 and trim(a.RDB$RELATION_NAME) = 'TABLE_NAME' ORDER BY a.RDB$RELATION_NAME, a.RDB$FIELD_POSITION