List Field definitions in forms

Questions and Answers about DataEase for Windows

List Field definitions in forms

Postby RonCarver » Thu Sep 12, 2013 7:52 pm

Is there a way to list the fields type, size and derivations in a form or table?

Like fieldx text 24 lookup xyz account
RonCarver
 
Posts: 7
Joined: Sat Feb 27, 2010 1:02 pm
Has thanked: 0 time
Been thanked: 0 time
 

Re: List Field definitions in forms

Postby Phil Winkler » Thu Sep 12, 2013 8:10 pm

Simple DQL. Ensure you have Show System Tables.

for $TableInfo$ ;
list records
TableName in groups ;
FldName ;
FldType ;
FldLength ;
FldDerivation .
Phil Winkler
PLM Consulting, Inc.
pwinkler@plmconsulting.com
Phil Winkler
 
Posts: 889
Joined: Fri Sep 07, 2007 12:45 pm
Has thanked: 0 time
Been thanked: 0 time
 

Re: List Field definitions in forms

Postby Adrian Jones » Fri Sep 13, 2013 7:32 am

You also need to go "Application --> Status --> Tables" or "Application --> Status --> Refresh" to populate these system tables. The data is only as good as the last time you run these options.

(Been a while since I used the refresh route, but it updates ALL the 'status' tables, including details about objects and derivations, etc. Sometimes the state of a document can result in this routine crashing. I've never worked out whether this might occur after the table data was populated, so you might want to try the refresh option first, and, if it bombs, out, do the tables one next.)
User avatar
Adrian Jones
 
Posts: 2000
Joined: Tue Sep 11, 2007 2:38 pm
Location: Cornwall, UK
Has thanked: 5 times
Been thanked: 4 times
 

Re: List Field definitions in forms

Postby Graham Smith » Fri Sep 13, 2013 11:57 am

The derivation is not stored in $TableInfo$ but is in a separate table. The FldDerivation field you see is a yes/no. Here is the DQL for one of the procedures I use. Note that I have defined a relationship for the Derivations form :
Code: Select all
/**********************
  All Rights Reserved
  Graham Smith
  PLM Consulting, Inc.
***********************/

define "tReq" text 1 .
define "tIdx" text 1 .
define "tUnq" text 1 .
define "tPre" text 1 .

for $TableInfo$
with TableName = data-entry TableName ;

tReq := blank .
tIdx := blank .
tUnq := blank .
tPre := blank .

if FldReqired    ="yes" then tReq := "X" . end .
if FldIndexed    ="yes" then tIdx := "X" . end .
if FldUnique     ="yes" then tUnq := "X" . end .
if FldNoEntry    ="yes" then tPre := "X" . end .

list records
   FldName ;
   FldType ;
   ColumnLength ;
   tReq ;
   tIdx ;
   tUnq ;
   tPre ;
   TableName .

    for _$DerivationInfo
    list records
   BRLText .
    end .
end .
Graham Smith
DataSmith, Delaware
"For every expert there is an equal and opposite expert.", Arthur C. Clarke (1917 - 2008)
"X-Clacks-Overhead: GNU Terry Pratchett"
User avatar
Graham Smith
 
Posts: 2501
Joined: Fri Sep 07, 2007 11:31 am
Location: Delaware, USA
Has thanked: 0 time
Been thanked: 1 time
 
 

Return to DataEase for Windows

Who is online

Users browsing this forum: No registered users and 2 guests

cron