4D v14.3

Structure Access Commands

Home

 
4D v14.3
Structure Access Commands

Structure Access Commands  


 

 

The commands in this theme return a description of the database structure. They can be used to find out the number of tables, the number of fields in each table, the names of the tables and fields, and the type and properties of each field. Utility commands can be used to detect and regenerate missing tables in order to recover "phantom" data.

Determining the database structure is extremely useful when you are developing and using groups of project methods and forms that can be copied into different databases.

The ability to read the database structure allows you to develop and use portable code.

Since version 11 of 4D, it is possible to delete tables and fields. This possibility means that the algorithms used in previous versions for counting tables and fields need to be modified. It is now necessary to use algorithms combining the Get last table number and Get last field number, as well as Is table number valid and Is field number valid commands. The following is an example of this type of algorithm:

 For($thetable;1;Get last table number)
    If(Is table number valid($thetable))
       For($thefield;1;Get last field number($thetable))
          If(Is field number valid($thetable;$thefield))
             ... `The field exists and is valid
          End if
       End for
    End if
 End for

 
PROPERTIES 

Product: 4D
Theme: Structure Access

 
SEE ALSO 

Field
GET FIELD PROPERTIES
Get last field number
Get last table number
Pointers
SET INDEX
Table
Table name

 
ARTICLE USAGE

4D Language Reference ( 4D v12.4)
4D Language Reference ( 4D v14 R3)
4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v13.5)
4D Language Reference ( 4D v14.3)
4D Language Reference ( 4D v14 R4)

Inherited from : Structure Access Commands ( 4D v11 SQL Release 6)