ADO .NET ODP Equivalent of DBMS_SESSION.SET_CONTEXT

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
 
D

David Browne

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top