Try OpenEdge Now
skip to main content
Programming Interfaces
Audit Policy Maintenance APIs : Generic utility API : isDBOnAppServer function
 

isDBOnAppServer function

Checks if the database specified by a given database information string is on the AppServer. If we are running a WebClient session, this is always the case, so it will always return true for the WebClient. The database information string is returned by get-complete-dbname-listprocedure, get-dbname-listprocedure, and src/auditing/_get-db-list.p.
Returns: LOGICAL
Parameters:
INPUT pcDbInfo AS CHARACTER
Database information string.
Example:
{auditing/include/_aud-utils.i}

DEFINE VARIABLE cdbInfo AS CHARACTER NO-UNDO.
DEFINE VARIABLE cList   AS CHARACTER NO-UNDO.
DEFINE VARIABLE cTemp   AS CHARACTER NO-UNDO.
DEFINE VARIABLE iLoop   AS INTEGER   NO-UNDO.

RUN get-dbname-list IN hAuditUtils (OUTPUT cList).

DO iLoop = 1 TO NUM-ENTRIES(cList, CHR(1)):
  ASSIGN cdbInfo = ENTRY(iLoop, cList, CHR(1))
         cTemp   = DYNAMIC-FUNCTION('get-DB-Name' IN hAuditUtils, cdbInfo).
  IF DYNAMIC-FUNCTION('isDbOnAppServer' IN  hAuditUtils, cDbInfo) THEN
    MESSAGE "Database " cTemp " is not local".
END.