getValueAsString do not work correctly with oracle number(1)
------------------------------------------------------------

                 Key: DDLUTILS-260
                 URL: https://issues.apache.org/jira/browse/DDLUTILS-260
             Project: DdlUtils
          Issue Type: Bug
          Components: Core - Oracle
    Affects Versions: 1.0
         Environment: oracle 9i
            Reporter: ddwcyl
            Assignee: Thomas Dudziak


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;
    }


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to