I created a foundset with this query:
var vSQL =
'SELECT distinct (orgcp.orgcp_id)
FROM orgcp
INNER JOIN contact contact1 ON orgcp.contact_id = contact1.contact_id
INNER JOIN contact_item contact_item1 ON orgcp.orgcp_id = contact_item1.orgcp_id WHERE contact1.gender = 1 AND contact_item1.phone IS NOT NULL
AND orgcp.owner_id = 1
ORDER BY orgcp.orgcp_id'
After loading the records (which works fine with controller.loadRecords(vSQL)), I want to retrieve the SQL again from the foundset by:
var vNewSQL = databaseManager.getSQL(foundset)
vNewSQL returns this -strange- query:
select orgcp_id from orgcp inner join #TEMP_8146842016 TEMP814684201665844 on orgcp_id=TEMP814684201665844.orgcp_id_8146842018 order by organisation_name asc
Is this a Servoy issue or is there a way to retrieve the correct query?
Version 3.5.2_04-build 515
Java version 1.6.0_02-b06 (Windows XP)
Sybase 10