1. John Vanleeuwe
  2. PowerBuilder
  3. Friday, 15 March 2019 13:29 PM UTC

Hi guys,

 

we are wondering if there's a way of getting a list of all the users connected to our application in a datawindow. we are using sqlanywhere as back-end.

 

i don't want to maintain a list with connections/deconnections myself.

 

any clues / tips / pointers ?

 

TIA

John

Accepted Answer
mike S Accepted Answer Pending Moderation
  1. Friday, 15 March 2019 13:49 PM UTC
  2. PowerBuilder
  3. # Permalink

sa_conn_info()

 

https://sqlanywhere-forum.sap.com/questions/24694/getting-list-of-connections-with-client-name-and-name-of-the-app

 

 

select userid,
CONNECTION_PROPERTY('Name', Number) AS program_name,
from sa_conn_info()

 

 

Comment
There are no comments made yet.
Olan Knight Accepted Answer Pending Moderation
  1. Monday, 18 March 2019 21:50 PM UTC
  2. PowerBuilder
  3. # 1

There's got to be a way to do this.

In Oracle, use the V$SESSION view.  V$SESSION displays session information for each current session.

 

A quick Google search turned up this:
   https://sqlanywhere-forum.sap.com/questions/6043/query-to-list-connected-users

and this:
   https://dba.stackexchange.com/questions/118225/list-all-sessions-from-current-user


Hope this helps!

Olan

Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Friday, 15 March 2019 14:06 PM UTC
  2. PowerBuilder
  3. # 2

I tried Mike's query and I get:

SQL_DBC_62d80c8

How do you specifiy the application name in the connection dbparm?

ASE for example has AppName and HostName.

Comment
  1. mike S
  2. Friday, 15 March 2019 16:01 PM UTC
with ODBC set the dbparm CON to the name of the application:

CON = yourappnam
  1. Helpful
There are no comments made yet.
Brad Mettee Accepted Answer Pending Moderation
  1. Friday, 15 March 2019 13:50 PM UTC
  2. PowerBuilder
  3. # 3

You can use the stored procedure "sa_conn_info" to see who's connected to the database. It will return with every current connection to the database server (so if your app creates 2 transaction objects and both connect at the same time, you'll see both from the same user). If there's more than one database open, you will get results for all of them. You can find out what db number you're assigned to, and filter the results based on it, by using "select connection_property('DBNumber') from dummy".

Hope this helps,

Brad 

 

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.