Find if the column.field exists in a table

Code:
find _file no-lock where _file._file-name = "customer" no-error.
if available( _file ) then
  do:
    find _field no-lock where _field._file-recid = recid( _file ) and _field._field-name = "name" no-error.
    if available( _field ) then message _file._file-name + "." + _field._field-name "exists".
  end.
 
if you know the database names, then you would prefix the _file with the databasename .
find <dbname>._file no-lock where <dbname>._file._file-name = "customer" no-error.

HTH
 
Back
Top