Показать сообщение отдельно
Старый 28.11.2007, 13:16   #4  
glibs is offline
glibs
Member
Сотрудники компании It Box
Most Valuable Professional
Лучший по профессии 2011
Лучший по профессии 2009
 
4,942 / 911 (40) +++++++
Регистрация: 10.06.2002
Адрес: I am from Kyiv, Ukraine. Now I am in Moscow. For private contacts: glibs@hotmail.com
Ниже цитата из руководства разработчика до кучи. И посмотрите еще поиск по форуму, много раз уже обсуждалось.

Temporary tables
Regard temporary tables as a temporary variable used to hold a table. A temporary table is intended to be used as a buffer for table data in X++ programs. Temporary tables are declared just like any other variable, and have the following characteristics:

They do not contain any data when they are first created

They obey normal scoping rules, that is, their scope is determined by where they are declared

They are automatically deleted by MorphX when they go out of scope

Temporary tables are not persistent. They are written to local disk storage but not stored in the database.

Temporary tables are used when you want a variable in X++ that has the same structure and characteristics as a table.

A note on temporary tables in a client-server environment, .

Temporary tables versus containers
MorphX supports a special data type called a container. In some cases this data type can be used in the same way as you would use a temporary table. If you want to read about the container data type, click .

One major difference between temporary tables and containers is that data in containers are stored sequentially, and thus retrieved sequentially, while a temporary table allows you to define indexes to speed up data retrieval. This means that containers provide slower data access if you are working with large numbers of records. However, if you are working with only a few records, you should use a container.

Another important difference between temporary tables and containers, is when using a temporary table in a method call, the information is passed by reference, while containers are passed by value. This means that if you are using a container as a parameter in a method call, it will be pushed on the system stack. If you are keeping many records in a container, and then pass it as a parameter, it will be pushed on the internal system stack. If your computer has a limited amount of memory, this causes the computer to start swapping part of the memory space to the disk, which slows down the execution of your application. In this case you should use a temporary table instead of a container.

Creating a temporary table
Temporary tables are created just like any other table. The only thing you have to do, is to set the Temporary property to Yes. To learn how to create a table, click .
__________________
С уважением,
glibs®
За это сообщение автора поблагодарили: Logger (1).