protected static string GetCastSql(tgCastType castType) { switch (castType) { case tgCastType.Boolean: return("Bit"); case tgCastType.Byte: return("TinyInt"); case tgCastType.Char: return("Char"); case tgCastType.DateTime: return("DateTime"); case tgCastType.Double: return("Float"); case tgCastType.Decimal: return("Decimal"); case tgCastType.Guid: return("UniqueIdentifier"); case tgCastType.Int16: return("SmallInt"); case tgCastType.Int32: return("Int"); case tgCastType.Int64: return("BigInt"); case tgCastType.Single: return("Real"); case tgCastType.String: return("NVarChar"); default: return("error"); } }
protected static string GetCastSql(tgCastType castType) { switch (castType) { case tgCastType.Char: return("CHAR"); case tgCastType.DateTime: return("DATETIME"); case tgCastType.Double: return("DECIMAL"); case tgCastType.Decimal: return("DECIMAL"); case tgCastType.Int16: return("SIGNED"); case tgCastType.Int32: return("SIGNED"); case tgCastType.Int64: return("SIGNED"); case tgCastType.Single: return("DECIMAL"); case tgCastType.String: return("CHAR"); default: return("error"); } }
protected static string GetCastSql(tgCastType castType) { switch (castType) { case tgCastType.Boolean: return("bit"); case tgCastType.Byte: return("tinyint"); case tgCastType.Char: return("character"); case tgCastType.DateTime: return("datetime"); case tgCastType.Double: return("double"); case tgCastType.Decimal: return("decimal"); case tgCastType.Guid: return("varchar"); case tgCastType.Int16: return("smallint"); case tgCastType.Int32: return("integer"); case tgCastType.Int64: return("bigint"); case tgCastType.Single: return("real"); case tgCastType.String: return("varchar"); default: return("error"); } }
protected static string GetCastSql(tgCastType castType) { switch (castType) { case tgCastType.Boolean: return("bool"); case tgCastType.Byte: return("tinyint"); case tgCastType.Char: return("char"); case tgCastType.DateTime: return("timestamp"); case tgCastType.Double: return("float8"); case tgCastType.Decimal: return("numeric"); case tgCastType.Guid: return("uuid"); case tgCastType.Int16: return("int2"); case tgCastType.Int32: return("int4"); case tgCastType.Int64: return("int8"); case tgCastType.Single: return("float4"); case tgCastType.String: return("varchar"); default: return("error"); } }
protected static string GetCastSql(tgCastType castType) { switch (castType) { case tgCastType.Boolean: return("NUMBER"); case tgCastType.Byte: return("RAW"); case tgCastType.Char: return("CHAR"); case tgCastType.DateTime: return("TIMESTAMP"); case tgCastType.Double: return("NUMBER"); case tgCastType.Decimal: return("NUMBER"); case tgCastType.Guid: return("RAW"); case tgCastType.Int16: return("INTEGER"); case tgCastType.Int32: return("INTEGER"); case tgCastType.Int64: return("INTEGER"); case tgCastType.Single: return("NUMBER"); case tgCastType.String: return("VARCHAR2"); default: return("error"); } }
protected static string GetCastSql(tgCastType castType) { switch (castType) { case tgCastType.Boolean: return "Bit"; case tgCastType.Byte: return "TinyInt"; case tgCastType.Char: return "Char"; case tgCastType.DateTime: return "DateTime"; case tgCastType.Double: return "Float"; case tgCastType.Decimal: return "Decimal"; case tgCastType.Guid: return "UniqueIdentifier"; case tgCastType.Int16: return "SmallInt"; case tgCastType.Int32: return "Int"; case tgCastType.Int64: return "BigInt"; case tgCastType.Single: return "Real"; case tgCastType.String: return "NVarChar"; default: return "error"; } }
/// <summary> /// Cast informs the DataProviders that a SQL CAST operation is needed. This overloaded version /// of Cast is useful for Casting decimal types /// </summary> /// <remarks> /// In C# you can cast with the overloaded cast operators, like this: (tgString)query.Age /// </remarks> /// <param name="castType">The type of cast needed</param> /// <returns>The very same tgQueryItem now with Cast instructions</returns> public tgQueryItem Cast(tgCastType castType, int precision, int scale) { tgQuerySubOperator subOp = new tgQuerySubOperator(); subOp.SubOperator = tgQuerySubOperatorType.Cast; subOp.Parameters["tgCastType"] = castType; subOp.Parameters["precision"] = precision; subOp.Parameters["scale"] = scale; this.AddSubOperator(subOp); return this; }
/// <summary> /// Cast informs the DataProviders that a SQL CAST operation is needed. This overloaded version /// of Cast is useful for Casting variable length character columns /// </summary> /// <remarks> /// In C# you can cast with the overloaded cast operators, like this: (tgString)query.Age /// </remarks> /// <param name="castType">The type of cast needed</param> /// <returns>The very same tgQueryItem now with Cast instructions</returns> public tgQueryItem Cast(tgCastType castType, int length) { tgQuerySubOperator subOp = new tgQuerySubOperator(); subOp.SubOperator = tgQuerySubOperatorType.Cast; subOp.Parameters["tgCastType"] = castType; subOp.Parameters["length"] = length; this.AddSubOperator(subOp); return this; }
protected static string GetCastSql(tgCastType castType) { switch (castType) { case tgCastType.Boolean: return "bit"; case tgCastType.Byte: return "tinyint"; case tgCastType.Char: return "char"; case tgCastType.DateTime: return "datetime"; case tgCastType.Double: return "float"; case tgCastType.Decimal: return "decimal"; case tgCastType.Guid: return "uniqueidentifier"; case tgCastType.Int16: return "smallint"; case tgCastType.Int32: return "int"; case tgCastType.Int64: return "bigint"; case tgCastType.Single: return "real"; case tgCastType.String: return "nvarchar"; default: return "error"; } }
protected static string GetCastSql(tgCastType castType) { switch (castType) { case tgCastType.Char: return "CHAR"; case tgCastType.DateTime: return "DATETIME"; case tgCastType.Double: return "DECIMAL"; case tgCastType.Decimal: return "DECIMAL"; case tgCastType.Int16: return "SIGNED"; case tgCastType.Int32: return "SIGNED"; case tgCastType.Int64: return "SIGNED"; case tgCastType.Single: return "DECIMAL"; case tgCastType.String: return "CHAR"; default: return "error"; } }
protected static string GetCastSql(tgCastType castType) { switch (castType) { case tgCastType.Boolean: return "NUMBER"; case tgCastType.Byte: return "RAW"; case tgCastType.Char: return "CHAR"; case tgCastType.DateTime: return "TIMESTAMP"; case tgCastType.Double: return "NUMBER"; case tgCastType.Decimal: return "NUMBER"; case tgCastType.Guid: return "RAW"; case tgCastType.Int16: return "INTEGER"; case tgCastType.Int32: return "INTEGER"; case tgCastType.Int64: return "INTEGER"; case tgCastType.Single: return "NUMBER"; case tgCastType.String: return "VARCHAR2"; default: return "error"; } }
protected static string GetCastSql(tgCastType castType) { switch (castType) { case tgCastType.Boolean: return "bool"; case tgCastType.Byte: return "tinyint"; case tgCastType.Char: return "char"; case tgCastType.DateTime: return "timestamp"; case tgCastType.Double: return "float8"; case tgCastType.Decimal: return "numeric"; case tgCastType.Guid: return "uuid"; case tgCastType.Int16: return "int2"; case tgCastType.Int32: return "int4"; case tgCastType.Int64: return "int8"; case tgCastType.Single: return "float4"; case tgCastType.String: return "varchar"; default: return "error"; } }