Jump to content
Sign in to follow this  
TELOS KIM

Manager, I am using datasnap on fmx mobile. How can I handle it on mobile using TTask.Run(..)? Thanks in advance for your help.

Recommended Posts

Procedure TfmMaster.btn Click OK (Sender: TObject);
var InStr : string;
begin
     for var i := 0 to Memo2.Lines.Count -1  
     begin
                InStr := copy(Memo2.Lines.Strings ,1,18) ;
                 bQry.Close;
                 bQry.CommandText :=
                         ' UPDATE "acCountsB" sET state = 1'
                  +#10+' where substring(barcoding,1,18) = '''+ InStr +''' '
                  +#10+' and state is null ; '
                  +#10+'Select a4_ box quantity ,'
                  +#10+' Sum(state) As system,'
                  +#10+' A8_Invoice number ,A3_Delivery tracking ,A3_Unit price ,A7_Serial number,A0 _Vendor coding,'
                  +#10+' A1_Seller Name, A8_Part Number, A9_Product Name, A4_Standard, A1_ Eco, A2_Quantity,'
                  +#10+' A1_Acquired Customer Name,ItemName'
                  +#10+' from "acCounts" a'
                  +#10+' Right Join "acCountsB" b on ( Left(a.A8_invoice number,

                  +#10+' and Substring(b. Invoice number,1,18) in'
                  +#10+' (Select Left(Invoice Number,18) from "'+DBTO+'acCountsB" b'
                  +#10+' Right Join "acCounts" a on (Left(a.A8_Invoice Number,18) = Left(b.Invoice Number,18) )'
                  +#10+' where substring(barcoding,1,18) = '''+ InStr + ''' '
                  +#10+' and status is not null )'
                  +#10+' and a.A8_Buy Male<>''Cancel'''
                  +#10+'Group By 1'
                  +#10+' total = a4_ box quantity' ; bQry.open
            try;
                  bQry.open;
            except
                      Get_ErrorEvent_Post( DM.Qry , StringReplace(bQry.CommandText,DBTO,'',[rfReplaceAll]) );
             End;
                sleep (100);

             if bQry.RecordCount > 0 then
             begin
                InStr := copy( bQry.FieldByName('A8_InvoiceNumber').AsString,1 ,18) ;
                aQry.CommandText := 'update acCountsB set state = Null                     '#10
                            +' where substring(invoice number,1,18) = '''+ InStr +''' ;          '#10
                            +' Update 'Account' a.A8_Shipping Status = '+cBaeSongStar+'    '#10
                            +' ,a.A5_Delivery Departure = '''+jesaStartEnd+'''                     '#10
                            +' ,a .A3_tracking = a.A3_tracking+'''+jesatEndComCode+'''+#10  '#10
                            +' ,a.A5_processor = '''+tusername+'/'+tid +'''                         '#10
                            +' left outer join "acCounts" b on (a.A8_invoice number=b.A8_invoice number) '#10
                            +' where substring(A8_invoice number,1,18) = '''+ InStr +' ''        '#10
                            +' and A8_Shipping Status = '+cJeSaEnd+'                              '#10
                            +' and A8_Purchase change <>''Cancel'' ;                                 ';
                    try
                         aQry.Execute ;
                    exception
                         Get_ErrorEvent_Post( DM.Qry , StringReplace(aQry.CommandText,DBTO,'',[rfReplaceAll]) );
                    End;

                end;
         End;
End;

Edited by TELOS KIM

Share this post


Link to post

Can you please translate your logic to English. It is extremely hard to follow what you are doing. Especially, since TTask.Run code is basically empty and it requires way more context.

Share this post


Link to post
15 hours ago, Dalija Prasnikar said:

당신의 논리를 영어로 번역해 주시겠습니까? 당신이 하는 일을 따라가는 것은 매우 어렵습니다. 특히 TTask.Run 코드는 기본적으로 비어 있기 때문에 더 많은 컨텍스트가 필요합니다.

Thank you for always.
Thanks for answering my question
I am using Android phone Datasnap environment.
In the Android environment, the query processing time is a little slow, so it bounces off.
Please provide an Android query example so that you can safely execute the query.
Edited by TELOS KIM

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×