Consultor Eletrônico



Kbase P133156: Which tables have records?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/07/2008
Status: Unverified

GOAL:

Which tables have records?

GOAL:

How can I determine if a table has records using the table name?

GOAL:

How do I list all the tables containing records?

FACT(s) (Environment):

Windows
Unix
Progress 9.x
OpenEdge 10.x

FIX:

The following code will list the tables with "Some" where the records exist and "None"
where there is no record.
DEF VAR hB AS HANDLE.
DEF VAR vc AS CHAR.
DEF VAR vl AS LOGICAL.
FOR EACH _file WHERE NOT _hidden:
CREATE BUFFER hB FOR TABLE _file._file-name.
vl = hb:FIND-FIRST("", NO-LOCK ) NO-ERROR.
IF vl THEN DO:
DISPLAY _file._file-name "Some" @ vc .
END.
ELSE
DISPLAY _file._file-name "None" @ vc .
DELETE OBJECT hB.
END.