#1 2015-04-27 11:29:27

cypriotcalm
Member
Registered: 2015-02-18
Posts: 122

TSQLRecordClass with different tables/table names

I have a bit dynamic database model. Some tables will be created only then if some data was measured and has to be saved into the database. These tables get unique names which are each time different. The table structure is always the same, only the table names differs.

I would like to map these tables with mORMot because I don't want to use SQL directly.

How could I solve this problem with mORMot? Is there a possibility to use the same SQLRecordClass but each time with different table names?

I hope, you understand what my problem is and could help me!

Thank you in advance!

Offline

#2 2015-04-27 17:26:36

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: TSQLRecordClass with different tables/table names

In mORMot, the tables are identified by their class types..

What you can do is to map the class with a custom external table name, at runtime.
See the aExternalTableName parameter of function VirtualTableExternalRegister().
See http://synopse.info/files/html/api-1.18 … ALREGISTER
and http://synopse.info/files/html/Synopse% … l#TITL_120

Offline

Board footer

Powered by FluxBB