Показать сообщение отдельно
Старый 10.03.2018, 00:14   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
TempDB table on a form with multiple updates
Источник: http://alexvoy.blogspot.com/2018/03/...-multiple.html
==============

If you, like me, are still trying to understand how to use a TempDB table in a form and update it as many times as you need, or you are getting the error

"Cannot execute the required database operation.The method is only applicable to TempDB table variables that are not linked to existing physical table instance."

then you would better read the following short explanation.

Let's say your tempDB table is meant to be populated by request from a form on the server side.


In the form data source Init() we just initialize another tempDB buffer of the same type and link its physical instance to the current data source buffer.


<div style="background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">public void init()
{
super();
wblTableTmpLocal.doInsert();
delete_from wblTableTmpLocal;
<span style="color: #888888;">//wblTableTmp::populate(wblTableTmpLocal); //
public void rePopulate()
{
wblTableTmp::populate(wblTableTmpLocal);
wblTableTmp.linkPhysicalTableInstance(wblTableTmpLocal);
wblTableTmp_DS.research();
}


Populating method defined on the table, for example.


<div style="background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">static server void populate(wblTableTmp _wblTableTmp)
{
int k;

delete_from _wblTableTmp; <span style="color: #888888;">//
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.

Последний раз редактировалось Vadik; 10.03.2018 в 15:29.