Subject: | Colons are a valid part of a combined field name |
Colons are being seen as a separator, not a valid part of a field name.
For Example:
select IOGroup:GPElement.Address,
Number,
IOGroup:GPElement.GPElemType:Type,
Point:Equip:Location:Name,
Point:Equip:Plant:Name,
Point:Equip:Equip.Desig,
Point:Quantity:Name,
Point:Equip:Equip.Description,
Point
from Chan where 'IOGroup:DACUnit:Name='\''ST32'\'''
The field IOGroup:GPElement.GPElemType:Type is wrongly broken into two tokens:
IOGroup:GPElement.GPElemType
:Type
I'm using SQL:Tokenizer to add format "%s|" to each field, and yes, the last field needs a trailing | too.
The error occurs for tokens jj=6 and jj=7 below. ODDLY enough, token 17 is parsed correctly.
Here's debug output from my script: (note it stops processing fields after the last from, and yes, it will handle recursion, too,
though this example is not recursive.)
query was 'select
IOGroup:GPElement.Address,Number,IOGroup:GPElement.GPElemType:Type,Point:Equip:Location:Name,Point:Equip:Plant:Name,Point:Equip:Equi
p.Desig,Point:Quantity:Name,Point:Equip:Equip.Description,Point from Chan where IOGroup:DACUnit:Name='ST32';'
jj=0 selectCounter=0 token is 'select'
jj=1 selectCounter=1 token is ' '
jj=2 selectCounter=1 token is 'IOGroup:GPElement.Address'
jj=2 selectCounter=1 token now 'IOGroup:GPElement.Address format "%s|"'
jj=3 selectCounter=1 token is ','
jj=4 selectCounter=1 token is 'Number'
jj=4 selectCounter=1 token now 'Number format "%s|"'
jj=5 selectCounter=1 token is ','
jj=6 selectCounter=1 token is 'IOGroup:GPElement.GPElemType'
jj=6 selectCounter=1 token now 'IOGroup:GPElement.GPElemType format "%s|"'
jj=7 selectCounter=1 token is ':Type'
jj=7 selectCounter=1 token now ':Type format "%s|"'
jj=8 selectCounter=1 token is ','
jj=9 selectCounter=1 token is 'Point:Equip:Location:Name'
jj=9 selectCounter=1 token now 'Point:Equip:Location:Name format "%s|"'
jj=10 selectCounter=1 token is ','
jj=11 selectCounter=1 token is 'Point:Equip:Plant:Name'
jj=11 selectCounter=1 token now 'Point:Equip:Plant:Name format "%s|"'
jj=12 selectCounter=1 token is ','
jj=13 selectCounter=1 token is 'Point:Equip:Equip.Desig'
jj=13 selectCounter=1 token now 'Point:Equip:Equip.Desig format "%s|"'
jj=14 selectCounter=1 token is ','
jj=15 selectCounter=1 token is 'Point:Quantity:Name'
jj=15 selectCounter=1 token now 'Point:Quantity:Name format "%s|"'
jj=16 selectCounter=1 token is ','
jj=17 selectCounter=1 token is 'Point:Equip:Equip.Description'
jj=17 selectCounter=1 token now 'Point:Equip:Equip.Description format "%s|"'
jj=18 selectCounter=1 token is ','
jj=19 selectCounter=1 token is 'Point'
jj=19 selectCounter=1 token now 'Point format "%s|"'
jj=20 selectCounter=1 token is ' '
jj=21 selectCounter=1 token is 'from'
query now 'select IOGroup:GPElement.Address format "%s|",Number format "%s|",IOGroup:GPElement.GPElemType format "%s|":Type format
"%s|",Point:Equip:Location:Name format "%s|",Point:Equip:Plant:Name format "%s|",Point:Equip:Equip.Desig format
"%s|",Point:Quantity:Name format "%s|",Point:Equip:Equip.Description format "%s|",Point format "%s|" from Chan where
IOGroup:DACUnit:Name='ST32';'