4D v16.3

Structure Access Commands

Home

 
4D v16.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.

Note: You can create and modify 4D fields and tables by programming using the commands of 4D's integrated SQL kernel, like CREATE TABLE or ALTER TABLE. For more information, refer to the "4D SQL Reference" manual.

It is possible to delete 4D tables and fields. You must take this possibility into account in algorithms used for counting tables and fields. It is 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



See also 

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

 
PROPERTIES 

Product: 4D
Theme: Structure Access

 
HISTORY 

 
ARTICLE USAGE

4D Language Reference ( 4D v16)
4D Language Reference ( 4D v16.1)
4D Language Reference ( 4D v16.2)
4D Language Reference ( 4D v16.3)