Parse error unidac
Posted: Thu 20 Oct 2016 13:21
c++ builder XE10 pro, unidac 6.4.14, TUniQuery.
This sql is correctly parsed:
This one is not (I get "Empty Macro or function name" at design-time when saving the query, even not when opening it)
Why wy why? Only one macro is used, truncate, and the syntax used is the same in both statements.
This sql is correctly parsed:
Code: Select all
SELECT {fn TRUNCATE(DESTROY_DATE,'')} as closedate, sealbag, sb_type
FROM vsectransdetok
WHERE DEPT=:1 AND SB_TYPE=:2
AND {fn TRUNCATE(DESTROY_DATE,'')}={fn TRUNCATE({CURRENTDATE},'')}
GROUP BY {fn TRUNCATE(DESTROY_DATE,'')}, sealbag, sb_type
ORDER BY {fn TRUNCATE(DESTROY_DATE,'')}, sealbag, sb_type
Code: Select all
SELECT o.SEALBAG, si.name as gache, pr.name as product, o.tsCreate, o.ObjectKey, o.infoText, o.infoDate, {fn truncate(sm1.ondt,'')} as dtgache, {fn truncate(sm2.ondt,'')} as dtdestroy, o.cnt, o.job
FROM objectsToClass o join sites si on o.info1=si.id join products pr on o.product=pr.id
left outer join stockmoves sm1 on o.stockId1=sm1.ID left outer join stockmoves sm2 on o.stockId2=sm2.ID
WHERE o.ObjectType=:1
AND o.TSCREATE BETWEEN :2 and :3
GROUP by o.sealbag, si.name, pr.name, o.tsCreate, o.ObjectKey, o.infoText, o.infoDate, {fn truncate(sm1.ondt,'')}, {fn truncate(sm2.ondt,'')}, o.cnt, o.job
order by o.sealbag, si.name, pr.name, o.tsCreate, o.ObjectKey, o.infoText, o.infoDate, {fn truncate(sm1.ondt,'')}, {fn truncate(sm2.ondt,'')}, o.cnt, o.job