KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Numbers of Deleted Tables and Fields
PRODUCT: 4D Developer | VERSION: 11 | PLATFORM: Mac & Win
Published On: April 23, 2008

When you delete a Table or a Field, the rest of the tables and fields of the database do not get renumbered.

Consequently, a database can contain tables and fields that are not numbered sequentially. In addition, when new Tables and Fields are added the numbers of deleted Tables and Fields are reused for the new ones.

Using the commands Count tables and Count fields no longer provides you with accurate information. These commands do not take into account the "holes" left in the sequences of Table and Field numbers left by deleting them.

New commands are now available in 4D v11 SQL to manage Table and Field numbers.
Count tables is now Get last table number and Count Fields is now Get last field number. In addition, there are two new commands Is table number valid and Is field number valid to count database Tables and Fields.


Get last table number

Get last field number

Is Table number valid

Is field number valid

Commented by Randy Shepherd on July 16, 2010 at 11:04 AM
WARNING!!! THIS IS A VERY SERIOUS CONSIDERATION!!! USE WITH CARE!!!

Deleting tables in 4D without adding new tables back in the place of the deleted tables WILL CAUSE SERIOUS PROBLEMS WITH 4D CHART AND SUPER REPORT PRO PLUGINS!!!! These and many other plugins expect to have sequential and contiguous table numbers. So, creating new tables (even ones without fields in them) can ensure there are no holes in the numbers for table numbers. It will also let you continue to use the old 4D Command "Count tables".