Transfer SQL sentence from Navision to Excel

I want to create a PivotTable in Excel sending a SQL instruction from Navision (ES 2.60F). I have a problem when I run the code, I find an Error message that Tehr are not memory free to run this task. The problem is in the instruction ExPivotCache.CommandText := ‘SQL sentence’ if the SQL sentence is larger than 1000 characters appears the error. Do you know what can I do to transfer SQL sentences larger than 1000 characters? One solution would be create a SQL View an Call the view in the sentence, but I prefer avoid this solution. Thank you.