Why is QBSorts.add(functionSortAsc) discarded in final SQL?

Questions, tips and tricks and techniques for scripting in Servoy

Why is QBSorts.add(functionSortAsc) discarded in final SQL?

Postby boonstrj » Fri Jan 25, 2013 11:50 am

In the query builder you can add a sort on a function result, but to my disapointment it is totally discarded without any warning in the final query on the database. See trace log below:

    used sql select Hut_id, abs((StandardNrOfBeds-?)), (StandardNrOfBeds-?) from tbl_hut where Location_id = ? and [Number] <= ? and (StandardNrOfBeds+RoomForExtraBeds) >= ? order by RoomForExtraBeds asc questiondata.length 5
    QuerySet { prepares = <null>, select = select Hut_id, abs((StandardNrOfBeds-?)), (StandardNrOfBeds-?) from tbl_hut where Location_id = ? and [Number] <= ? and (StandardNrOfBeds+RoomForExtraBeds) >= ? order by RoomForExtraBeds asc [[3.0,3.0,JSUNITTSTLOC,8,3.0]] <0^-1>, cleanups = <null> }
    SELECT servoy_6_restinn_cm:dbo:tbl_hut<db:/restinn/tbl_hut>#tblhut6266.1073743372=Hut_id<12,12,0>,ABS[MINUS[servoy_6_restinn_cm:dbo:tbl_hut<db:/restinn/tbl_hut>#tblhut6266.1073743382=StandardNrOfBeds<5,0,0>,<anonymous>=${nrOfPersons=3.0}] null] null,MINUS[servoy_6_restinn_cm:dbo:tbl_hut<db:/restinn/tbl_hut>#tblhut6266.1073743382=StandardNrOfBeds<5,0,0>,<anonymous>=${nrOfPersons=3.0}] null FROM servoy_6_restinn_cm:dbo:tbl_hut<db:/restinn/tbl_hut>#tblhut6266 <anonymous> ((servoy_6_restinn_cm:dbo:tbl_hut<db:/restinn/tbl_hut>#tblhut6266.1073743379=Location_id<1,12,0>)=([<anonymous>=${locationId=JSUNITTSTLOC}]) AND (servoy_6_restinn_cm:dbo:tbl_hut<db:/restinn/tbl_hut>#tblhut6266.1073743380=Number<5,0,0>)<=([<anonymous>=${maxHutNumber=8}]) AND (PLUS[servoy_6_restinn_cm:dbo:tbl_hut<db:/restinn/tbl_hut>#tblhut6266.1073743382=StandardNrOfBeds<5,0,0>,servoy_6_restinn_cm:dbo:tbl_hut<db:/restinn/tbl_hut>#tblhut6266.1073743381=RoomForExtraBeds<5,0,0>] null)>=([<anonymous>=${nrOfPersons=3.0}])) ORDER BY ABS[MINUS[servoy_6_restinn_cm:dbo:tbl_hut<db:/restinn/tbl_hut>#tblhut6266.1073743382=StandardNrOfBeds<5,0,0>,<anonymous>=${nrOfPersons=3.0}] null] null ASC,MINUS[servoy_6_restinn_cm:dbo:tbl_hut<db:/restinn/tbl_hut>#tblhut6266.1073743382=StandardNrOfBeds<5,0,0>,<anonymous>=${nrOfPersons=3.0}] null DESC,ABS[servoy_6_restinn_cm:dbo:tbl_hut<db:/restinn/tbl_hut>#tblhut6266.1073743382=StandardNrOfBeds<5,0,0>] null ASC,servoy_6_restinn_cm:dbo:tbl_hut<db:/restinn/tbl_hut>#tblhut6266.1073743381=RoomForExtraBeds<5,0,0> ASC FILTER null
Is this not implemented yet ? Or can it only be used under certain circumstances ?
Jeroen Boonstra
2Serve-IT

Servoy version 5.2.13/6.1.x/7.1.0
boonstrj
 
Posts: 63
Joined: Mon Jan 07, 2008 11:49 am
Location: Netherlands

Re: Why is QBSorts.add(functionSortAsc) discarded in final S

Postby rgansevles » Tue Jan 29, 2013 10:08 am

Jeroen,

The order-by on a function seems to be ignored in the sql generation.
Please file a case in our support system. https://support.servoy.com

Rob
Rob Gansevles
Servoy
User avatar
rgansevles
 
Posts: 1927
Joined: Wed Nov 15, 2006 6:17 pm
Location: Amersfoort, NL


Return to Methods

Who is online

Users browsing this forum: No registered users and 10 guests

cron