Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Consequences of using DBMS_APPLICATION_INFO.SET_CLIENT_INFO ???

Re: Consequences of using DBMS_APPLICATION_INFO.SET_CLIENT_INFO ???

From: Thomas Kyte <tkyte_at_oracle.com>
Date: 17 Oct 2002 06:27:59 -0700
Message-ID: <aomdsv02qg1@drn.newsguy.com>


In article <54df0379.0210160614.539d9f0f_at_posting.google.com>, PrivateBenjamin_at_hushmail.com says...
>
>Thomas Kyte <tkyte_at_oracle.com> wrote in message
>news:<aohoor0jdf_at_drn.newsguy.com>...
>> In article <54df0379.0210151032.238d6530_at_posting.google.com>,
>> PrivateBenjamin_at_hushmail.com says...
>> >
>> >Are there any multiuser issues regarding creating dynamic views using
>> >DBMS_APPLICATION_INFO.SET_CLIENT_INFO in the manner as below
>> >
>> >CREATE OR REPLACE VIEW VW_MYINVESTMENTS ( DRIVER,
>> >INV#, DESCRIPTION, USERID ) AS SELECT
>> > vw_TBLINVESTMENTS.INV_DRIVER# AS Driver,
>> > vw_TBLINVESTMENTS.INVESTMENT# AS "Inv#",
>> > vw_TBLINVESTMENTS.INVESTMENT_DESCRIPTION AS Description,
>> > VW_TBLEMPLOYEE.USERID
>> >FROM
>> > VW_TBLINVESTMENTS,
>> > VW_TBLEMPLOYEE
>> >WHERE
>> > VW_TBLINVESTMENTS.Employee# = vw_TBLEmployee.Employee# and
>> > VW_TBLEMPLOYEE.userid = userenv('client_info')
>> >
>> >then -------
>> >
>> >"BEGIN DBMS_APPLICATION_INFO.SET_CLIENT_INFO ( & '" & param & "')" &
>> >"; END;"
>> >
>> >For example, when multiple users are setting the environment variable
>> >will that affect the other users?
>> >
>> >
>> >Thanks
>> >April
>>
>>
>> client info is session "safe", each session has their own.
>>
>> this is a common technique -- but -- USE BIND VARIABLES when calling dbms_app
>>info -- don't concatenate like you show above -- looks like VB or Java -- so use
>> a ?
>>
>> "begin dbms_application_info.set_client_info(?); end;"
>>
>> and bind in param
>
>Thanks Tom,
>
>yes it is VB, actually VBA.
>
>dumb question I know, but how do I then Bind in the parameter?
>
>I send the statement "begin dbms_application_info.set_client_info(?);
>end;" to the server wrapped in an Access querydef in the form below.
>
>With qdf
> .connect = strConnect
> .ReturnsRecords = False
> .sql = "BEGIN DBMS_APPLICATION_INFO.SET_CLIENT_INFO (?); END;"
> .Execute dbFailOnError
>End With
>
>Secondly, just want to make sure..., there is only one Oracle user and
>multiple pcs are connecting using that user. So each connection is a
>separate session and therefore won't conflict?
>
>Thanks again for your help,
>April

You'll have to ask about in the VB groups for "how to bind in VB" -- I know

  1. you can do it
  2. you better do it

I've just never had the pleasure of writing in VB using ODBC myself.

each session will see *its* client_info, even tho they all use the same user id.

--
Thomas Kyte (tkyte@oracle.com)             http://asktom.oracle.com/ 
Expert one on one Oracle, programming techniques and solutions for Oracle.
http://www.amazon.com/exec/obidos/ASIN/1861004826/  
Opinions are mine and do not necessarily reflect those of Oracle Corp 
Received on Thu Oct 17 2002 - 08:27:59 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US