Re: DirectSQL removing the ORDER BY clause


Avgerinos
 

Hi Joseph and thank you for your reply

I don't have 3.3d installed, but I also tried on 3.3g & 3.3h and the problem persists.

I also noticed that if I have an index defined in Magic, similar to the ORDER-BY clause, Magic will not remove the ORDER BY from the direct SQL.

Regards
Avgerinos

On 18/12/2020 5:54 μ.μ., Joseph Feldman wrote:
I tried it on Magic 3.3d and the order by clause is not removed, and is working fine

Joseph

On Thu, Dec 17, 2020 at 2:22 PM Avgerinos <mento@...> wrote:
Hi magicians

In XPA 3.3c, I have a simple online task that uses a Direct SQL command to select the TOP-10 records from a table:
SELECT TOP 10  [product], [price], [volume], [value]    FROM [dbo].[orders]    WHERE [product] = 'TEST'   ORDER BY [volume] DESC

When I run the program I get a different result set compared to what I 'm getting when I run the query in the Management Studio (MSSQL 2014).
By checking via the SQL profiler, I found out that Magic is removing the ORDER BY clause when executing the command.

Anyone experienced something similar? Any way to avoid?

Best regards
Avgerinos


Join main@magicu-l.groups.io to automatically receive all group messages.