KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: 4D v12.1 provides more help converting subtables
PRODUCT: 4D | VERSION: 12.1 | PLATFORM: Mac & Win
Published On: February 24, 2011

For databases being converted to 4D v12 from versions prior to 4D v11 SQL what to do about subtables has been and is a vexing issue. Subtables are no longer supported beginning with 4D v11 SQL. 4D has strongly recommended that they be replaced with standard related tables. However, if a database has made significant use of subtables the effort to convert to standard tables requires a strong strategy and significant man hours.

Understanding this, in 4D v11 SQL and 4D v12, former subtables continue to function in converted database thanks to a compatibility mechanism. But this does not eliminate the desire to eliminate this compatibility mechanism and treat the converted subtables in the conventional way, especially in SQL statements.

To make this easier, a new command has been added in 4D v12.1: Get subrecord key.

When a pre-v11 database with subtables is converted, a special link is created between the one-table and the many-table, like that shown in the image below:



This special link is used by the Subrecords commands as the compatibility mechanism. Before 4D v12.1 the values contained in this link were private.

Get subrecord key facilitates the progressive replacement of subrecords commands. By using this command to disconnect processing of the special relation created for converted subtables (so that you can later remove this relation definitively). If your database contains converted subtables, it is a good idea to take advantage of this new command in order to modify your code so that it no longer uses subtables.