How to know source of DML

How to know source of DML

Postby Olof » Tue 10 Apr 2012 06:29

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 !
Olof
 
Posts: 7
Joined: Thu 09 Jun 2011 11:18

Postby Pinturiccio » Tue 10 Apr 2012 13:07

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.
Pinturiccio
Devart Team
 
Posts: 2046
Joined: Wed 02 Nov 2011 09:44

Postby Olof » Wed 11 Apr 2012 05:59

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
   ...
Olof
 
Posts: 7
Joined: Thu 09 Jun 2011 11:18


Return to dotConnect for Oracle