Hello Communtiy,
i want to convert the following x++ statement to sql:
static void UpdateCustTransDescription(Args _args)
{
CustInvoiceLine custInvoiceLine;
CustInvoiceTable custInvoiceTable;
CustInvoiceJour custinvoiceJour;
CustTrans custTrans;
ttsBegin;
while select forUpdate custTrans
where !custTrans.Txt && custTrans.RecId == 5637355326
join custInvoiceJour
where custinvoiceJour.InvoiceId == custTrans.Invoice
&& custinvoiceJour.InvoiceAccount == custTrans.AccountNum
&& custinvoiceJour.InvoiceDate == custTrans.TransDate
&& custinvoiceJour.LedgerVoucher == custTrans.Voucher
join custInvoiceTable
where custInvoiceTable.InvoiceId == custinvoiceJour.InvoiceId
join custInvoiceLine
where custInvoiceLine.ParentRecId == custInvoiceTable.RecId
{
custTrans.Txt = custInvoiceLine.Description;
custTrans.doUpdate();
}
ttsCommit;
}
Might you please advising me how i can achieve this? how i should proceed?
Is there any best practices that i should be aware of in order to improve the performance of this statement?
P.S:
I don't wanna use "generateOnly forceLiterals" as the generated query looks little bit too complicated to execute.
*This post is locked for comments
I have the same question (0)