Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Posts
    1

    Unanswered: the information about a connection in progress

    Is there any function that can get the information of a connection in progress? such as pid, tty .. etc.

  2. #2
    Join Date
    Feb 2004
    Location
    Pittsburgh, PA
    Posts
    41
    Quote Originally Posted by cschang
    Is there any function that can get the information of a connection in progress? such as pid, tty .. etc.
    What platform? And which database?

  3. #3
    Join Date
    Nov 2003
    Location
    Lomza, POLAND
    Posts
    81
    Here you are the simple procedure, which shows all connections and locks applied by them:

    /* connusr.p */
    /* BogdanB - procedure displays list of processes
    actually connected to db */

    def var tableName as char no-undo.

    for each _Connect
    no-lock /*,
    each _User
    where _User._Userid = _Connect._Connect-Name
    no-lock */ :

    if _Connect._Connect-Usr = ? then
    next.

    display
    _Connect._Connect-Id
    _Connect._Connect-Usr
    _Connect._Connect-Type
    _Connect._Connect-Name
    _Connect._Connect-Pid
    with centered .

    for each _Lock
    no-lock
    on error undo, leave
    on stop undo, leave:
    if _Lock._Lock-Usr = ? then
    leave.
    if _Lock._Lock-Usr <> _Connect._Connect-Usr then
    next.

    find _File
    where _File._File-Number = _Lock._Lock-Table
    no-lock no-error.
    if not avail(_File) then
    tableName = "ERROR: no table!".
    else
    tableName = _File._File-Name.

    display
    _Lock._Lock-Type
    tableName format "X(32)"
    _Lock._Lock-RecId
    _Lock._Lock-Flags
    with centered .
    end.
    end.
    pause.
    quit.

    Hope it helps.
    Bogdan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •