Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I was recently having trouble getting an SQL query to work and there seems to be some undocumented behaviour when certain keywords are used in the query.
My query looked like this:
WHERE
slot.rackGroup == $1.rackGroup
AND slot.hasSpace($1.pallet)
AND (slot.slotSKU == $1.storageCode OR slot.slotSKU == "<none>")
AND (slot.preferredType == $1.type OR slot.preferredType == "<none>")
ORDER BY
(slot.slotSKU == $1.storageCode) DESC,
(slot.preferredType == $1.type) DESC,
slot.storageObject.name ASC,
slot.bayID ASC,
slot.levelID ASC,
slot.slotID ASC
The parameter $1 is a pointer to token.
I found that if I re-labelled token.type to token._type and used $1._type in the query above, it worked.
It seems as if the SQL query treats .type differently, as if it is some sort of reserved keyword.
Interestingly, the documentation for Find Slot actually uses $1.Type as an example, so it is just $1.type that gives trouble.
Is there any documentation that covers this?
Is there a list or guidance on what keywords should not be used as token labels?
Solved! Go to Solution.