I'm not sure I understand the "addresses SQL query" part but pretty much anything you run in SSMS you can run in ESQL and with exactly the same query. I routinely run complicated queries via ESQL that are over 4K or 5K and some larger
I was trying to run something similar to this (note i have just pasted the code here just so you can get the idea, it is missing bits and it is not in compile state )

Code:
            Move "select CustomerCode, CustomerName, PhoneNo, EmailAddress, Address1, Address2, Address3, PostCode, " to sSQLARCUSTQuery
            Move (Append(sSQLARCUSTQuery, "Z_AccountStatus, OrderNoRequired, Z_Rating, Z_TrailmaxxRating, Category1, Category2, ")) to sSQLARCUSTQuery
            Move (Append(sSQLARCUSTQuery, "SalespersonCode, SalesAreaCode, OtherPartyCode, CreatedDate, CreatedTime, ModifiedDate, ModifiedTime from ARCUST ")) to sSQLARCUSTQuery
            
            //Execute the statement, we do it only once so use direct execution
            Send SQLExecDirect of hARCUSTStmt sSQLARCUSTQuery
            //Traverse the result set
            Repeat
                Get SQLFetch of hARCUSTStmt to iFetchARCUSTResult
                If (iFetchARCUSTResult <> 0) Begin
                    Get SQLColumnValue of hARCUSTStmt 1  to sCustomerCode
                    Get SQLColumnValue of hARCUSTStmt 2  to sCustomerName


//                    Move (Trim(sCustomerCode)) to sCustomerCode
                    Move sCustomerCode to ARCUSTI.CustomerCode
                    Find eq ARCUSTI by Index.1


                            //SQL Query
                            Move "select AddressNo, CustomerCode, DeliveryCode, DeliveryAddress1, DeliveryAddress2, DeliveryAddress3, " to sSQLARADDRQuery 
                            Move (Append(sSQLARADDRQuery, "DeliveryAddress4, DeliveryPostCode from ARADDR ")) to sSQLARADDRQuery


                            Move (Append(sSQLARADDRQuery, "Where CustomerCode = '")) to sSQLARADDRQuery
                            Append sSQLARADDRQuery (Trim(sCustomerCode)) "'" 


                            
                            //Execute the statement, we do it only once so use direct execution
                            Send SQLExecDirect of hARADDRStmt sSQLARADDRQuery
                            //Traverse the result set
                            Repeat
                                Get SQLFetch of hARADDRStmt to iFetchARADDRResult
                                If (iFetchARADDRResult <> 0) Begin