I am using insert_recordset to insert data in a custom table by using following query;
insert_recordset myTable (LineAmountMST,Qty, ItemId, InventDimId, InvoiceDate
, InventSizeId, InventColorId
, OperatingUnitID
, COGS
)
SELECT SUM(LineAmountMST), SUM(Qty), ItemId, InventDimId, InvoiceDate
from CustInvoiceTrans
JOIN CustInvoiceJour
where CustInvoiceTrans.SalesId == CustInvoiceJour.SalesId
&& CustInvoiceTrans.InvoiceId == CustInvoiceJour.InvoiceId
&& CustInvoiceTrans.InvoiceDate == CustInvoiceJour.InvoiceDate
&& CustInvoiceTrans.numberSequenceGroup == CustInvoiceJour.numberSequenceGroup
&& CustInvoiceTrans.InvoiceDate >= start
&& CustInvoiceTrans.InvoiceDate <= end
OUTER JOIN InventSizeId, InventColorId
from InventDim
where CustInvoiceTrans.InventDimId == InventDim.InventDimId
OUTER JOIN OMInternalOrganization
from RetailCustInvoiceJourTable
group by RetailCustInvoiceJourTable.OMInternalOrganization,
CustInvoiceTrans.ItemId, CustInvoiceTrans.inventdimid, CustInvoiceTrans.InvoiceDate
, InventDim.InventSizeId, InventDim.InventColorId
where CustInvoiceJour.RecId == RetailCustInvoiceJourTable.CustInvoiceJour
OUTER JOIN InventTransOrigin
where CustInvoiceTrans.InventTransId == InventTransOrigin.InventTransId
OUTER JOIN sum(COGS) from KSPInventTransGrouped
where CustInvoiceTrans.InvoiceId == KSPInventTransGrouped.InvoiceId
&& InventTransOrigin.RecId == KSPInventTransGrouped.InventTransOrigin;
but it is showing following errors;
- [SQL ServerCannot insert the value NULL into column 'Field', table 'AxDB.dbo.MYTABLE'; column does not allow nulls. INSERT fails.
- Object Server Azure:
- Cannot insert multiple records in MYTABLE (MYTABLE). The SQL database has issued an error.
Any solution to resolve this issue?