How to know source of DML

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
Olof
Posts: 8
Joined: Thu 09 Jun 2011 11:18

How to know source of DML

Post by 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 !

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Post by 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.

Olof
Posts: 8
Joined: Thu 09 Jun 2011 11:18

Post by 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
   ...

Post Reply