Developer forum

Forum » Integration » Dynamicweb Provider failing to move data from temporary table

Dynamicweb Provider failing to move data from temporary table

Mario Santos Dynamicweb Employee
Mario Santos
Reply

Hi,

I am setting up an import job from Excel Provider to Dynamicweb Provider, for a custom DB table. I checked db key columns are set on the job, but keep getting the error below.
What am I missing?

DW 9.20.4.

Error: failed to move data from temporary table [dbo._StockAllotmentsTempTableForBulkImport1] to main table [dbo._StockAllotments]. Exception: ExecuteNonQuery: CommandText property has not been initialized Sql query: Stack: at Dynamicweb.DataIntegration.Providers.SqlProvider.SqlDestinationWriter.MoveDataToMainTable(SqlTransaction sqlTransaction, Boolean updateOnly, Boolean insertOnly) at Dynamicweb.DataIntegration.Providers.DynamicwebProvider.DynamicwebProvider.RunJob(Job job). System.Exception: failed to move data from temporary table [dbo._StockAllotmentsTempTableForBulkImport1] to main table [dbo._StockAllotments]. Exception: ExecuteNonQuery: CommandText property has not been initialized Sql query: ---> System.InvalidOperationException: ExecuteNonQuery: CommandText property has not been initialized at System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at Dynamicweb.DataIntegration.Providers.SqlProvider.SqlDestinationWriter.MoveDataToMainTable(SqlTransaction sqlTransaction, Boolean updateOnly, Boolean insertOnly) --- End of inner exception stack trace --- at Dynamicweb.DataIntegration.Providers.SqlProvider.SqlDestinationWriter.MoveDataToMainTable(SqlTransaction sqlTransaction, Boolean updateOnly, Boolean insertOnly) at Dynamicweb.DataIntegration.Providers.DynamicwebProvider.DynamicwebProvider.RunJob(Job job)  

 
 
 
 

Replies

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
 
Mario Santos Dynamicweb Employee
Mario Santos
Reply

Hi Dmitrij,

I saw that post, but my table is a custom table not connected any ecom tables. The job only has a single data table mapping.

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Mario,
it looks like the problem is that you have both Insert and Updated options activated at the same time, so try to choose one of them.
BR, Dmitrij

 
Mario Santos Dynamicweb Employee
Mario Santos
Reply

Hi Dmitrij,

I have unchecked both but facing a different issue related to column UpdatedOn, which I have selected a script in data integration job. The UI does not allow to select the checkbox to enable that column mapping and save.

 

Import job failed: failed to move data from temporary table [dbo._StockAllotmentsTempTableForBulkImport1] to main table [dbo._StockAllotments]. Exception: Cannot insert the value NULL into column 'UpdatedOn', table 'uat-altria.mydwsite5.com.dbo._StockAllotments'; column does not allow nulls. INSERT fails. The statement has been terminated. Sql query: update [dbo].[_StockAllotments] set [TotalAllotment]=[dbo].[_StockAllotmentsTempTableForBulkImport1].[TotalAllotment], [AvailableAllotment]=[dbo].[_StockAllotmentsTempTableForBulkImport1].[AvailableAllotment] from [dbo].[_StockAllotmentsTempTableForBulkImport1] where [dbo].[_StockAllotments].[Username]=[dbo].[_StockAllotmentsTempTableForBulkImport1].[Username] and [dbo].[_StockAllotments].[PosNumber]=[dbo].[_StockAllotmentsTempTableForBulkImport1].[PosNumber] ; insert into [dbo].[_StockAllotments] ([Username],[PosNumber],[TotalAllotment],[AvailableAllotment]) (select [dbo].[_StockAllotmentsTempTableForBulkImport1].[Username], [dbo].[_StockAllotmentsTempTableForBulkImport1].[PosNumber], [dbo].[_StockAllotmentsTempTableForBulkImport1].[TotalAllotment], [dbo].[_StockAllotmentsTempTableForBulkImport1].[AvailableAllotment] from [dbo].[_StockAllotmentsTempTableForBulkImport1] left outer join [dbo].[_StockAllotments] on [dbo].[_StockAllotments].[Username]=[dbo].[_StockAllotmentsTempTableForBulkImport1].[Username] and [dbo].[_StockAllotments].[PosNumber]=[dbo].[_StockAllotmentsTempTableForBulkImport1].[PosNumber] where [dbo].[_StockAllotments].[Username] is null);  
 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply
This post has been marked as an answer

Hi Mario,
that is a UI bug in DW9, I have created #27285 to fix that. As a workaround you can manually activate it in the job xml file for now:
<columnMapping>
<scriptType>CurrentTime</scriptType>
<scriptValue />
<isKey>False</isKey>
<isActive>True</isActive>
<scriptValueForInsert>False</scriptValueForInsert>
<destinationColumn>CommentCreatedDate</destinationColumn>
</columnMapping>
BR, Dmitrij

Votes for this answer: 1

 

You must be logged in to post in the forum