Ejemplo n.º 1
0
        static public void GetResultOfNestedQueryForInStatement(HqlTokenProcessor processor, ArrayList list)
        {
            try
            {
                HqlStream cs = new HqlStream(processor.GetRemainingSql(true), ")");
                if (cs.CountReturnVisibleFields != 1)
                {
                    throw new Exception("Internal Hql streams must return only one value");
                }

                for (; !cs.EndOfStream;)
                {
                    string s = cs.ReadLine();
                    if (s == null || s.Length == 0)
                    {
                        continue;
                    }

                    HqlToken token = new HqlToken(HqlWordType.UNKNOWN, s);
                    HqlTokenProcessor.Categorize(ref token, false, false, true, false);
                    if (token.WordType == HqlWordType.UNKNOWN)
                    {
                        token = new HqlToken(HqlWordType.LITERAL_STRING, token.Data);
                    }
                    list.Add(token);
                }
                cs.Close();
                processor.SetRemainingSql(cs.RemainingSql);
            }
            catch (Exception ex)
            {
                throw new Exception("Unable to execute nested IN statement SQL", ex);
            }
        }