Page 1 of 1

Unidac + DSP + CDS + Order By in search problem

Posted: Thu 02 Aug 2012 13:05
by rrcanalista
Hi, some times, some querys does not retrieve all records according he where clauses when there is Order By command in the end.

Ex:
sQL := ' SELECT TABLE1.*,'+
' T2.FIELD1,'+
' T3.FIELD2,'+
' FROM TABLE1 T1 '+
' LEFT JOIN TABLE2 T2 ON (T2.FIELD_ID = T1.FIELD_ID)'+
' LEFT JOIN TABLE3 T3 ON (P3.FIELD_ID = T3.FIELD_ID)';
if I dont add the "Order By", the records retrieve correctly, but if I add the order by, Ex: "Order by T1.FIELD_PK" the result only retrieve some records, for example, it should retrieve 15 records but only 2 records are retrieved.

Re: Unidac + DSP + CDS + Order By in search problem

Posted: Thu 02 Aug 2012 13:44
by AndreyZ
Hello,

This problem is caused by the specificity of the TDataSetProvider component work. To solve the problem, you should set the TDataSetProvider.Options.poRetainServerOrder option to True.