TOO_MANY_ROWS exception when querying the V$SESSION table ?
642846Jul 1 2009 — edited Jul 1 2009Can you guys think of a reason why the following query would generate a TOO_MANY_ROWS exception?
select substr(program,1,instr(program,'@')-1)
into v_prog
from v$session
where audsid = userenv('SESSIONID');
The above code is embedded in a (insert, update, and delete) trigger on a table (let's call it TABLE_A) in our database. We have a forms application which modifies TABLE_A (program = 'FRMWEB@..."); but we also want to audit anyone who inserts, updates, or deletes from TABLE_A (hence the trigger).
After the trigger executes, I query the v$session table and unless I am missing something, there seems to be only one record for the given audsid. What am I missing?
Thanks in advance,
Mike