Consultor Eletrônico



Kbase P53928: How to write a message to the database log file?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   9/18/2007
Status: Unverified

GOAL:

How to write a message to the database log file?

GOAL:

How to get the database log file name?

GOAL:

How to get the database log file location?

FACT(s) (Environment):

Progress 9.x

FIX:

How to write a message to the database log file?

To write a message to the database log file, use the Progress 4GL OUTPUT TO statement. The following code outputs the string 'this is a test' to the database log file. It is assumed here that the database log file is in the PROPATH.

OUTPUT TO VALUE(SEARCH(DBNAME + ".lg")) APPEND.
PUT "this is a test".

FIX:

How to get the database log file name?

To get the database log file name, use the Progress 4GL DBNAME function. The following code would return the database log file name of the currently active database:

MESSAGE
(DBNAME + ".lg")
VIEW-AS ALERT-BOX.

FIX:

How to get the database log file location?

To get the database log file location is possible only if the database directory is in the session PROPATH or on the same network as the client. The Progress 4GL expression:

SEARCH(DBNAME + ".lg")

would return the location of the database log file if the database is in the PROPATH.

If the database is NOT in the PROPATH. The following 4GL code constructs a list of the currently connected database _AreaStatus-LastExtent files. This list may be used as a first step towards constructing a list of the various directories that the database files reside on. One could search those directories using the INPUT FROM OS-DIR statement to locate the database log file:

DEFINE VARIABLE cDirectoryList AS CHARACTER NO-UNDO.

FOR EACH _AreaStatus NO-LOCK.

IF cDirectoryList = "" THEN
cDirectoryList = _AreaStatus-LastExtent.
ELSE
cDirectoryList = cDirectoryList + chr(3) + _AreaStatus-LastExtent.
END.

MESSAGE cDirectoryList
VIEW-AS ALERT-BOX INFO BUTTONS OK.