0 Replies Latest reply on Jun 5, 2019 5:41 PM by Saurabh Verma-Oracle

    ODI-17669: DdlPattern must be set before calling method isLengthAllowed.

    Saurabh Verma-Oracle

      Would anyone know why this code snippet will result in ODI-17669: DdlPattern must be set before calling method isLengthAllowed. The error happens on .setLength and .setScale methods

       

      Saurabh

       

                                  OdiColumn col = new OdiColumn(srcDatastore, rs.getObject("COLUMN_NAME").toString());

                                  col.setPosition(i++);

                                 

                                  String targetDataType = null;

       

                                  switch (rs.getObject("TYPE_NAME").toString()) {

                                  case "WVARCHAR" : {targetDataType = "VARCHAR";} break;

                                      case "TIMESTAMP" : {targetDataType = "DATE";} break;

                                      case "NUMBER": {targetDataType = "NUMBER";} break;

                                  case "DOUBLE": {targetDataType = "NUMBER";} break;

                                  }

       

                                  col.setDataTypeCode(targetDataType);

                                  col.setLength((Integer) rs.getObject("COLUMN_SIZE"));

                                  col.setScale((Integer) rs.getObject("DECIMAL_DIGITS"));

                                  col.setMandatory(rs.getObject("IS_NULLABLE")=="YES"?false:true);