ADO .NET ODP Equivalent of DBMS_SESSION.SET_CONTEXT

  • Thread starter Thread starter istccgd
  • Start date Start date
I

istccgd

Is there a way using the ODP for .NET (Oracle 9i, .NET 1.1) to set the
context for calling a stored procedure, using .NET code?

For example, I want to do the equivalent of the following:

DBMS_SESSION.SET_CONTEXT('rowlevelaudit_ctx', 'userid', 'Chris');

in VB .NET so that during subsequent calls, I can do the follwoing:

SELECT SYS_CONTEXT ('rowlevelaudit_ctx', 'userid')
INTO v_username
FROM DUAL;

The greater goal here is to have row level auditing by user, while
still having ony a single login to the database. I want to avoid having
to pass in each individual's userid to every single stored procedure.

Any help would be greatly appreciated,

Chris
 
Is there a way using the ODP for .NET (Oracle 9i, .NET 1.1) to set the
context for calling a stored procedure, using .NET code?

For example, I want to do the equivalent of the following:

DBMS_SESSION.SET_CONTEXT('rowlevelaudit_ctx', 'userid', 'Chris');

Just do that. You can run any PL/SQL code you want.

Remember that PL\SQL must be formed up into blocks if you use
CommandType.Text

BEGIN DBMS_SESSION.SET_CONTEXT('rowlevelaudit_ctx', 'userid', 'Chris'); END;

David
 
Back
Top