Page 1 of 1

How to know source of DML

Posted: Tue 10 Apr 2012 06:29
by Olof
Hi,

I'm searching the best way to find, in an Oracle trigger, from where come the DML order.

We are rewriting a big application (from Oracle Forms to .NET), and some code in trigger must not be called when the "client" is .NET.

I can use different Oracle user, and test it in triggers, but are they best solutions ?


Thank you !

Posted: Tue 10 Apr 2012 13:07
by Pinturiccio
You can assign the Client Id parameter in the connection string. Then you can check

Code: Select all

sys_context('userenv', 'clientid') = "Your Client Id in your connection string"
and do not perform the trigger.

Posted: Wed 11 Apr 2012 05:59
by Olof
Thank you Pinturiccio,

just a little correction, 'userenv' and 'client_identifier' have to be uppercase :

Code: Select all

if (sys_context('USERENV','CLIENT_IDENTIFIER') = 'blablabla') then
   ...