| INM V12 Database for Director
||General database and table use
In some applications, it is useful to create more than one Xtra instance for a given table. The advantage of such a duplication is to keep several selections and several current records for the same table.
This example defines two table instances (gTable1 and gTable2) for the table: articles. The selection in gTable1 is sorted by order of price, whereas in gTable2 it is sorted by order of name.
set gTable1 = New(Xtra "V12table", mGetRef(gDB), "articles")
set gTable2 = New(Xtra "V12table", mGetRef(gDB), "articles")
1. The multiple instance definition technique is sometimes convenient for Read-Only databases but can lead to inconsistencies when used in Read/Write mode. This happens particularly when editing a current record that is also the current record of the other instance.
2. Each table instance takes up RAM.