@Override
  public String getFieldDefinition(
      IValueMeta v,
      String tk,
      String pk,
      boolean use_autoinc,
      boolean add_fieldname,
      boolean add_cr) {
    String retval = "";

    String fieldname = v.getName();
    int length = v.getLength();
    int precision = v.getPrecision();

    if (add_fieldname) retval += fieldname + " ";

    int type = v.getType();
    switch (type) {
      case IValueMeta.TYPE_DATE:
        retval += "DATETIME";
        break;
        // Move back to Y/N for bug - [# 1538] Repository on MS ACCESS: error creating repository
      case IValueMeta.TYPE_BOOLEAN:
        if (supportsBooleanDataType()) {
          retval += "BIT";
        } else {
          retval += "CHAR(1)";
        }
        break;
      case IValueMeta.TYPE_NUMBER:
      case IValueMeta.TYPE_INTEGER:
      case IValueMeta.TYPE_BIGNUMBER:
        if (fieldname.equalsIgnoreCase(tk)
            || // Technical key
            fieldname.equalsIgnoreCase(pk) // Primary   key
        ) //
        {
          if (use_autoinc) {
            retval += "COUNTER PRIMARY KEY";
          } else {
            retval += "LONG PRIMARY KEY";
          }
        } else {
          if (precision == 0) {
            if (length > 9) {
              retval += "DOUBLE";
            } else {
              if (length > 5) {
                retval += "LONG";
              } else {
                retval += "INTEGER";
              }
            }
          } else {
            retval += "DOUBLE";
          }
        }
        break;
      case IValueMeta.TYPE_STRING:
        if (length > 0) {
          if (length < 256) {
            retval += "TEXT(" + length + ")";
          } else {
            retval += "MEMO";
          }
        } else {
          retval += "TEXT";
        }
        break;
      case IValueMeta.TYPE_BINARY:
        retval += " LONGBINARY";
        break;
      default:
        retval += " UNKNOWN";
        break;
    }

    if (add_cr) retval += CR;

    return retval;
  }
  @Override
  public String getFieldDefinition(
      IValueMeta v,
      String tk,
      String pk,
      boolean use_autoinc,
      boolean add_fieldname,
      boolean add_cr) {
    String retval = "";

    String fieldname = v.getName();
    int length = v.getLength();
    int precision = v.getPrecision();

    if (add_fieldname) {
      retval += fieldname + " ";
    }

    int type = v.getType();
    switch (type) {
      case IValueMeta.TYPE_DATE:
        retval += "DATETIME YEAR to FRACTION";
        break;
      case IValueMeta.TYPE_BOOLEAN:
        if (supportsBooleanDataType()) {
          retval += "BOOLEAN";
        } else {
          retval += "CHAR(1)";
        }
        break;
      case IValueMeta.TYPE_NUMBER:
      case IValueMeta.TYPE_INTEGER:
      case IValueMeta.TYPE_BIGNUMBER:
        if (fieldname.equalsIgnoreCase(tk)
            || // Technical key
            fieldname.equalsIgnoreCase(pk) // Primary key
        ) {
          if (use_autoinc) {
            retval += "SERIAL8";
          } else {
            retval += "INTEGER PRIMARY KEY";
          }
        } else {
          if ((length < 0 && precision < 0) || precision > 0 || length > 9) {
            retval += "FLOAT";
          } else { // Precision == 0 && length<=9
            retval += "INTEGER";
          }
        }
        break;
      case IValueMeta.TYPE_STRING:
        if (length >= CLOB_LENGTH) {
          retval += "CLOB";
        } else {
          if (length < 256) {
            retval += "VARCHAR";
            if (length > 0) {
              retval += "(" + length + ")";
            }
          } else {
            if (length < 32768) {
              retval += "LVARCHAR";
            } else {
              retval += "TEXT";
            }
          }
        }
        break;
      default:
        retval += " UNKNOWN";
        break;
    }

    if (add_cr) {
      retval += CR;
    }

    return retval;
  }