VirtualQuery - AS does not work correctly
Posted: Mon 15 Jan 2018 16:03
Hello,
VirtualQuery does not use the AS statement in the source datasets correctly. Originally I had a TMyQuery with something like this:
SELECT id AS pid, CONCAT(firstname, lastname) AS fullname
and it worked with fullname, but not with pid in a VirtualQuery. To reproduce the behaviour I appended a simple example only with VirtualDAC:
One VirtualTable t1 with 3 fields: id, caption, fullname
One VirtualQuery q1 with SQL: SELECT t1.id AS pid FROM t1
One VirtualQuery q2 with SQL: SELECT * FROM q1
The result of the FieldList in q2 is "id" and not as expected "pid".
I would like to append a zip file to reproduce the error but found no upload link.
Kind regards
Harald
VirtualQuery does not use the AS statement in the source datasets correctly. Originally I had a TMyQuery with something like this:
SELECT id AS pid, CONCAT(firstname, lastname) AS fullname
and it worked with fullname, but not with pid in a VirtualQuery. To reproduce the behaviour I appended a simple example only with VirtualDAC:
One VirtualTable t1 with 3 fields: id, caption, fullname
One VirtualQuery q1 with SQL: SELECT t1.id AS pid FROM t1
One VirtualQuery q2 with SQL: SELECT * FROM q1
The result of the FieldList in q2 is "id" and not as expected "pid".
I would like to append a zip file to reproduce the error but found no upload link.
Kind regards
Harald