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

Re: ADO .NET ODP Equivalent of DBMS_SESSION.SET_CONTEXT by David

David
Wed Oct 26 12:19:14 CDT 2005


<istccgd@omh.state.ny.us> wrote in message
news:1130337414.505402.150180@g47g2000cwa.googlegroups.com...
> 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