Example #1
0
 public override SqlType GetCombinedType(SqlType otherType, int operation)
 {
     if (operation != 0x24)
     {
         return(this.GetAggregateType(otherType));
     }
     if (otherType == null)
     {
         return(this);
     }
     if (!otherType.IsRowType())
     {
         throw Error.GetError(0x15ba);
     }
     SqlType[] dataTypes  = new SqlType[this._dataTypes.Length];
     SqlType[] typesArray = ((RowType)otherType).GetTypesArray();
     if (this._dataTypes.Length != typesArray.Length)
     {
         throw Error.GetError(0x15bc);
     }
     for (int i = 0; i < this._dataTypes.Length; i++)
     {
         dataTypes[i] = this._dataTypes[i].GetAggregateType(typesArray[i]);
     }
     return(new RowType(dataTypes));
 }
Example #2
0
 public override object ConvertToType(ISessionInterface session, object a, SqlType othType)
 {
     if (a == null)
     {
         return(null);
     }
     if (othType == null)
     {
         return(a);
     }
     if (!othType.IsRowType())
     {
         throw Error.GetError(0x15ba);
     }
     SqlType[] typesArray = ((RowType)othType).GetTypesArray();
     if (this._dataTypes.Length != typesArray.Length)
     {
         throw Error.GetError(0x15bc);
     }
     object[] objArray  = (object[])a;
     object[] objArray2 = new object[objArray.Length];
     for (int i = 0; i < objArray.Length; i++)
     {
         objArray2[i] = this._dataTypes[i].ConvertToType(session, objArray[i], typesArray[i]);
     }
     return(objArray2);
 }
Example #3
0
 public override bool CanConvertFrom(SqlType othType)
 {
     if (othType != null)
     {
         if (!othType.IsRowType())
         {
             return(false);
         }
         SqlType[] typesArray = ((RowType)othType).GetTypesArray();
         if (this._dataTypes.Length != typesArray.Length)
         {
             return(false);
         }
         for (int i = 0; i < this._dataTypes.Length; i++)
         {
             if (!this._dataTypes[i].CanConvertFrom(typesArray[i]))
             {
                 return(false);
             }
         }
     }
     return(true);
 }