DdlUtils
  1. DdlUtils
  2. DDLUTILS-260

getValueAsString do not work correctly with oracle number(1)

    Details

      Description

      i use ddlutil to get insertSql for some tables .when the column type is number(1),SqlBulder.getValueAsString return's value is "ture",otherwise myvalue is "1",
      it seems ddlutil think number(1) is bool. an other's issue is getValueAsString return's value is '123' when my value is 123.
      i try fixed it in Oracle8Builder override getValueAsString,the code is
      @Override
      protected String getValueAsString(Column column, Object value) {
      String result;
      if (value == null)

      { return "NULL"; }

      switch(column.getTypeCode())
      {
      //number(1) type
      case Types.BIT:
      if("true".equals(value.toString()))

      {result = "1";}

      else

      {result="0";}

      break;
      case Types.INTEGER:
      result = escapeStringValue(value.toString());
      break;
      case Types.NUMERIC:
      result = escapeStringValue(value.toString());
      break;
      default:
      result = super.getValueAsString(column, value);
      }
      return result;
      }

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Thomas Dudziak
            Reporter:
            ddwcyl
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development