SQL Parsing error

Found in:

  • atelier-1.0.0AT.142.0
  • Cache for UNIX (Apple Mac OS X for x86-64) 2016.2 (Build 636U) Wed Apr 13 2016 21:07:40 EDT

Breaks on FOR SOME when using a table reference:

  • + 1
  • 0
  • 235
  • 1
  • 2

Answers

This is a bug in my ANTLR grammar for ISC SQL.

I will fix on Tuesday and get back to you.

Would you mind attaching the code from above image, so I don't have to retype.

Thanks,

Jonathan Levinson

 

Here you go - this will compile in USER namespace

Class User.SQLForSome Extends %Persistent {

Property Name As %String;

Property Domains As list Of %String;

Index Domains On Domains(ELEMENTS) [ Type = bitmap ];

Query TestQuery(Favorites As %List) As %SQLQuery(ROWSPEC = "Name:%String") {
    SELECT Name
    FROM   SQLForSome
    WHERE  FOR SOME %ELEMENT(Domains)(%VALUE %INLIST :Favorites)
}

// Broken when table alias used. Still will save/compile though
Query TestQueryBroken(Favorites As %List) As %SQLQuery(ROWSPEC = "Name:%String") {
    SELECT foo.Name
    FROM   SQLForSome foo
    WHERE  FOR SOME %ELEMENT(foo.Domains)(%VALUE %INLIST :Favorites)
}

Storage Default
{
<Data name="SQLForSomeDefaultData">
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Domains</Value>
</Value>
<Value name="3">
<Value>Name</Value>
</Value>
</Data>
<DataLocation>^User.SQLForSomeD</DataLocation>
<DefaultData>SQLForSomeDefaultData</DefaultData>
<IdLocation>^User.SQLForSomeD</IdLocation>
<IndexLocation>^User.SQLForSomeI</IndexLocation>
<StreamLocation>^User.SQLForSomeS</StreamLocation>
<Type>%Library.CacheStorage</Type>
}

}

The fix to this SQL problem will be in next available build.