Beispiel #1
0
        public override DbTypeInfo GetColumnDbTypeInfo(InfoRow columnRow)
        {
            var  charSize       = columnRow.GetAsLong("CHARACTER_MAXIMUM_LENGTH");
            var  byteSize       = columnRow.GetAsLong("CHARACTER_OCTET_LENGTH");
            long size           = charSize != 0 ? charSize : byteSize;
            var  dataTypeString = columnRow.GetAsString("DATA_TYPE").ToLowerInvariant();
            var  prec           = (byte)columnRow.GetAsInt("NUMERIC_PRECISION");
            var  scale          = (byte)columnRow.GetAsInt("NUMERIC_SCALE");
            var  typeInfo       = Driver.TypeRegistry.GetDbTypeInfo(dataTypeString, size, prec, scale);

            return(typeInfo);
        }
 public virtual DbTypeInfo GetColumnDbTypeInfo(InfoRow columnRow) {
   var charSize = columnRow.GetAsLong("CHARACTER_MAXIMUM_LENGTH");
   var byteSize = columnRow.GetAsLong("CHARACTER_OCTET_LENGTH");
   long size = charSize != 0 ? charSize : byteSize; 
   var dataTypeString = columnRow.GetAsString("DATA_TYPE").ToLowerInvariant();
   var prec = (byte) columnRow.GetAsInt("NUMERIC_PRECISION");
   var scale = (byte) columnRow.GetAsInt("NUMERIC_SCALE");
   var DT_PREC = "DATETIME_PRECISION";
   if (columnRow.Table.HasColumn(DT_PREC) && columnRow[DT_PREC] != DBNull.Value) {
     var dateTimePrec = columnRow.GetAsInt(DT_PREC);
     if(prec == 0)
       prec = (byte)dateTimePrec;
   }
   var isNullStr = columnRow.GetAsString("IS_NULLABLE");
   var isNullable = (isNullStr == "YES" || isNullStr == "Y"); //Oracle->Y
   var typeInfo = Driver.TypeRegistry.GetDbTypeInfo(dataTypeString, size, prec, scale);
   return typeInfo;
 }