Structure Access Commands

4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next

version 11 (Modified)


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.

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.

Counting tables and fields

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 and 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.


4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next