Exemplo n.º 1
0
 public override void Resolve(Session session, RangeVariable[] rangeVars)
 {
     base.Resolve(session, rangeVars);
     if (this._statement != null)
     {
         this._statement.Resolve(session, rangeVars);
         base.ReadTableNames  = this._statement.GetTableNamesForRead();
         base.WriteTableNames = this._statement.GetTableNamesForWrite();
     }
     if (!this._conditionNames.IsEmpty())
     {
         int[]          indexes   = new int[this._conditionNames.Size()];
         ColumnSchema[] variables = new ColumnSchema[this._conditionNames.Size()];
         StatementSet.SetVariables(rangeVars, this._conditionNames, indexes, variables);
         for (int i = 0; i < this._conditionNames.Size(); i++)
         {
             ColumnSchema schema1 = variables[i];
             if (schema1 == null)
             {
                 throw Error.GetError(0x19e0, this._conditionNames.Get(i));
             }
             FwNs.Core.LC.cStatements.Condition condition = (FwNs.Core.LC.cStatements.Condition)schema1.GetDefaultExpression().GetValue(session);
             if (condition.IsSqlState)
             {
                 this._conditionStates.Add(condition.SqlState);
             }
             else
             {
                 this._conditionErroCodes.Add((int)condition.ErrNo.GetValue(session, SqlType.SqlInteger));
             }
         }
     }
 }
Exemplo n.º 2
0
        public override void Resolve(Session session, RangeVariable[] rangeVars)
        {
            bool flag = false;
            int  type = base.type;

            if (type <= 0x35)
            {
                if ((type != 9) && (type != 0x35))
                {
                    goto Label_01D3;
                }
                OrderedHashSet <string> colNames = new OrderedHashSet <string>();
                colNames.Add(this.cursorVariableName);
                int[]          indexes   = new int[colNames.Size()];
                ColumnSchema[] variables = new ColumnSchema[colNames.Size()];
                StatementSet.SetVariables(rangeVars, colNames, indexes, variables);
                this.cursorVariableNameIndex = indexes[0];
                this.variable = variables[0];
                if (this.cursorVariableNameIndex < 0)
                {
                    throw Error.GetError(0xe10);
                }
                if (this.variable == null)
                {
                    throw Error.GetError(0xe10);
                }
                flag = true;
                goto Label_01E3;
            }
            switch (type)
            {
            case 0x59:
                flag = true;
                goto Label_01E3;

            case 90:
                break;

            case 0x5b:
            case 0x5c:
                if (this._conditionName != null)
                {
                    OrderedHashSet <string> colNames = new OrderedHashSet <string>();
                    colNames.Add(this._conditionName.Name);
                    int[]          indexes   = new int[colNames.Size()];
                    ColumnSchema[] variables = new ColumnSchema[colNames.Size()];
                    StatementSet.SetVariables(rangeVars, colNames, indexes, variables);
                    this._conditionIndex = indexes[0];
                    if (this._conditionIndex == -1)
                    {
                        throw Error.GetError(0x19e0, this._conditionName.Name);
                    }
                }
                if (this._conditionInformationItems != null)
                {
                    foreach (Expression local1 in this._conditionInformationItems.Values)
                    {
                        ExpressionColumn.CheckColumnsResolved(local1.ResolveColumnReferences(rangeVars, null));
                        local1.ResolveTypes(session, null);
                    }
                }
                flag = true;
                goto Label_01E3;

            default:
                if (type == 0x66)
                {
                    for (StatementCompound compound = base.Parent; compound != null; compound = compound.Parent)
                    {
                        if ((compound.IsLoop && (compound.label != null)) && this.label.Name.Equals(compound.label.Name))
                        {
                            flag = true;
                            break;
                        }
                    }
                    goto Label_01E3;
                }
                break;
            }
Label_01D3:
            throw Error.RuntimeError(0xc9, "");
Label_01E3:
            if (!flag)
            {
                throw Error.GetError(0x15e2);
            }
        }