Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

TOO_MANY_ROWS exception when querying the V$SESSION table ?

642846Jul 1 2009 — edited Jul 1 2009
Can 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 29 2009
Added on Jul 1 2009
8 comments
1,582 views