Skip to Main Content
  • Questions
  • Setting Client identifier per C# Code

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Anouar.

Asked: September 26, 2019 - 4:27 pm UTC

Last updated: October 01, 2019 - 1:01 am UTC

Version: Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production

Viewed 1000+ times

You Asked

i'm trying to set the Client info in my C#-Application just by calling the Package 'DBMS_APPLICATION_INFO.SET_CLIENT_INFO'.

I notice that, my value is displayed under the 'OSUSER'-Column (V$session-View).

I expected, that my value appear unter the 'CLIENT_IDENTIFIER'-Column.

Here is the Code Section:

using (var cmd = new OracleCommand())
                    {
                        cmd.CommandType = System.Data.CommandType.StoredProcedure;
                        cmd.Connection = connection;
                        cmd.CommandText = "DBMS_APPLICATION_INFO.SET_CLIENT_INFO";

                        cmd.Parameters.Add("client_info", OracleDbType.Varchar2, "MYVALUE123", System.Data.ParameterDirection.Input);

                        connection.Open();
                        cmd.ExecuteNonQuery();
                    }


Can you please tell me how i can solve that

Thanks,
Anouar

and Connor said...

Couple of things here

1) I've never seen OSUSER populated with a call to DBMS_APPLICATION_INFO. I'd need to see some proof on that.

2) CLIENT_INFO and CLIENT_IDENTIFIER are different things (both in v$session)

CLIENT_INFO - set by DBMS_APPLICATION_INFO. Just contains any piece of information you like.
CLIENT_IDENTIFIER - set by DBMS_SESSION. Is used by various things for connection pooling, security contexts and proxy users.

Hope this helps.

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Wrong column

Anouar, September 27, 2019 - 9:46 am UTC

Thanks you for you answer.

Sorry, it was my error, I've see in the wrong column.
Connor McDonald
October 01, 2019 - 1:01 am UTC

glad we could help

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library