/////////////////////// // Constructors //private HqlField(HqlField field, bool hidden) //{ // Init(field._type); // _start = field._start; // _length = field._length; // _name = field._name; // _dec = field._dec; // _func = field._func; // _scalar = field._scalar; // _direction = field._direction; // _tableReference = field._tableReference; // _fieldRename = field._fieldRename; //} public HqlField(HqlFieldType type) // for STAR { if (type != HqlFieldType.STAR && type != HqlFieldType.ROWNUM && type != HqlFieldType.NULL && type != HqlFieldType.FILENAME) { throw new Exception("Instance is for STAR only"); } Init(type); }
public HqlField(HqlFieldType type, decimal decimalvalue) // for LITERAL_FLOAT { if (type != HqlFieldType.LITERAL_FLOAT) { throw new Exception("Instance is for FLOAT only"); } Init(type); _dec = decimalvalue; }
public HqlField(HqlFieldType type, Int64 IntValue) // for INTVALUE, decimal { if (type != HqlFieldType.LITERAL_INT) { throw new Exception("Instance is for IntValue only"); } Init(type); _start = IntValue; }
public HqlField(HqlFieldType type, int fieldNum) // for FIELDNUM, decimal { if (type != HqlFieldType.FIELDNUM) { throw new Exception("Instance is for FIELDNUM only"); } Init(type); _start = fieldNum; }
public HqlField(HqlFieldType type, HqlScalar scalar) // for SCALAR { if (type != HqlFieldType.SCALAR) { throw new Exception("Instance is for SCALAR only"); } Init(type); _scalar = scalar; }
public HqlField(HqlFieldType type, HqlFunction func) // for FUNCTION { if (type != HqlFieldType.FUNCTION) { throw new Exception("Instance is for FUNCTION only"); } Init(type); _func = func; }
public HqlField(HqlFieldType type, string literal) // for LITERAL { if (type != HqlFieldType.LITERAL_STRING) { throw new Exception("Instance is for LITERAL only"); } Init(type); _name = literal; }
private void Init(HqlFieldType type) { _type = type; _direction = HqlKeyword.ASCENDING; _tableReference = String.Empty; _fieldRename = null; _start = -1; _length = -1; _printResult = true; }
public HqlField(HqlFieldType type, int start, int length, string name) // for FIXEDWIDTH { if (type != HqlFieldType.FIXEDWIDTH) { throw new Exception("Instance is for FIXEDWIDTH only"); } Init(type); _start = start; _length = length; _name = name; }