SqlUtilEnumerateLoggedInUsers - cDbUpdateFunctionLibrary

Enumerates SQL logged in users for the passed driver ID and database name. Returns a tSQLLoggedInUser struct array.


Type: Function


Parameters: String sTableName, String sDriverID

Parameter

Description

sDriverID

MSSQLDRV_ID, DB2_DRV_ID, ODBC_DRV_ID, ORAFLEX, SQLFLEX, MDSPgSQL or MDSMySQL

sDatabase

The name of the SQL database


Syntax


Function SQLUtilEnumerateLoggedInUsers String sDriverID String sDatabase Returns tSQLLoggedInUser[]

Call:

Get SQLUtilEnumerateLoggedInUsers MSSQLDRV_ID "OrderEntry" to MyUserArray



Description

Use it to retrieve all SQL logged in users for an active database. The return value is a struct array. It relies on the SQLConnection string settings.



Example


   Procedure OnClick

       String sDatabase

       Integer iSize iCount

       tSQLLoggedInUser[] SQLLoggedInUsers

       

       Move "OrderEntry" to sDatabase

       Get SqlUtilEnumerateLoggedInUsers of ghoDbUpdateFunctionLibrary MSSQLDRV_ID sDatabase to SQLLoggedInUsers

       Move (SizeOfArray(SQLLoggedInUsers)) to iSize

       Decrement iSize

       

       For iCount from 0 to iSize

           Showln SQLLoggedInUsers[iCount]

       Loop

       

   End_Procedure