connection level variable

connection level variable

Post by Scott Urb » Wed, 16 Jul 2003 03:23:57



We use connection pools to access Sybase, so all the users appear to
the database as the the same ID.  I'm wondering if there is a way to
define a connection level variable, or something of the like, to tell
who is actually doing something in the db.  I would set the variable
on my connection when I get if from the pool then reference the
variable in the stored procs we use to save data.

I would be open to other solution types if anyone has one.

Thanks,
Scott Urban

 
 
 

connection level variable

Post by Anthony Mandi » Wed, 16 Jul 2003 13:30:45



> We use connection pools to access Sybase, so all the users appear to
> the database as the the same ID.  I'm wondering if there is a way to
> define a connection level variable, or something of the like, to tell
> who is actually doing something in the db.  I would set the variable
> on my connection when I get if from the pool then reference the
> variable in the stored procs we use to save data.

        There's no such variable, per se. A connection can pass parameters
        to sprocs though, so you could pass user information fashioned at
        the client end that way.

Quote:> I would be open to other solution types if anyone has one.

        Depending on the version of ASE you are using, you could set some
        extra fields that show up in sysprocesses (I think the 3 new
        fields came in with ASE 12.0). These are user settable for a
        session and could possibly be considered variables.

-am     ? 2003

 
 
 

connection level variable

Post by Scott Urb » Thu, 17 Jul 2003 00:21:41




> > We use connection pools to access Sybase, so all the users appear to
> > the database as the the same ID.  I'm wondering if there is a way to
> > define a connection level variable, or something of the like, to tell
> > who is actually doing something in the db.  I would set the variable
> > on my connection when I get if from the pool then reference the
> > variable in the stored procs we use to save data.

>    There's no such variable, per se. A connection can pass parameters
>    to sprocs though, so you could pass user information fashioned at
>    the client end that way.

> > I would be open to other solution types if anyone has one.

>    Depending on the version of ASE you are using, you could set some
>    extra fields that show up in sysprocesses (I think the 3 new
>    fields came in with ASE 12.0). These are user settable for a
>    session and could possibly be considered variables.

> -am        ? 2003

How do I interact with sysprocesses?  Through sql directly or is there
any kind of API?
 
 
 

connection level variable

Post by Scott Urb » Thu, 17 Jul 2003 00:42:30


I just found it:

set clientname "users_name"

works perfectly and solves my problem thanks

 
 
 

connection level variable

Post by Joseph Weinstei » Thu, 17 Jul 2003 00:44:02





> > > We use connection pools to access Sybase, so all the users appear to
> > > the database as the the same ID.  I'm wondering if there is a way to
> > > define a connection level variable, or something of the like, to tell
> > > who is actually doing something in the db.  I would set the variable
> > > on my connection when I get if from the pool then reference the
> > > variable in the stored procs we use to save data.

> >       There's no such variable, per se. A connection can pass parameters
> >       to sprocs though, so you could pass user information fashioned at
> >       the client end that way.

> > > I would be open to other solution types if anyone has one.

> >       Depending on the version of ASE you are using, you could set some
> >       extra fields that show up in sysprocesses (I think the 3 new
> >       fields came in with ASE 12.0). These are user settable for a
> >       session and could possibly be considered variables.

> > -am   ? 2003

> How do I interact with sysprocesses?  Through sql directly or is there
> any kind of API?

Through SQL direcctly. sysprocesses is simply a table, though it is a system table,
typically updated by the DBMS itself.
 
 
 

connection level variable

Post by Michael Pepple » Thu, 17 Jul 2003 01:19:48






>> > We use connection pools to access Sybase, so all the users appear to
>> > the database as the the same ID.  I'm wondering if there is a way to
>> > define a connection level variable, or something of the like, to tell
>> > who is actually doing something in the db.  I would set the variable
>> > on my connection when I get if from the pool then reference the
>> > variable in the stored procs we use to save data.

>>        There's no such variable, per se. A connection can pass parameters to
>>        sprocs though, so you could pass user information fashioned at the
>>        client end that way.

>> > I would be open to other solution types if anyone has one.

>>        Depending on the version of ASE you are using, you could set some extra
>>        fields that show up in sysprocesses (I think the 3 new fields came in
>>        with ASE 12.0). These are user settable for a session and could
>>        possibly be considered variables.

>> -am    ? 2003

> How do I interact with sysprocesses?  Through sql directly or is there any
> kind of API?

See the "set" commands - specifically "set [clientname <client name> |
clienthostname <client host name> | clientapplname <client application
name>]"

Michael
--
Michael Peppler                              Data Migrations, Inc.

Sybase T-SQL/OpenClient/OpenServer/C/Perl developer available for short or
long term contract positions - http://www.mbay.net/~mpeppler/resume.html

 
 
 

1. variable Priority level in 6.5?

Is there a way to change the priority level of a statement in 6.5?  I
need to run some queries, but there are many users logged in.  I don't
want my statement to slow them down.  What I want is to set my priority
level low enough that the users have processing priority over me.  Any
suggestions?  Thanks in advance for the help.

Will Summers

* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!

2. ORA - 01001 - Invalid cursor

3. Order Class vs Module-level variables

4. Oracle 8 On Dec Alpha & NT4

5. Session Level Variables

6. Loop for sp_updatestats

7. Hierarchies with variable levels on Oracle Express

8. Making Access DB visible to the world

9. Connection limit on database level

10. setting transaction isolation level on connection

11. ansi padding at connection level

12. Command Object vs Connection Object for Row Level Locking

13. Row-level Security and Connection Pooling