Menu

MColumn.getSQLDDL() with DEFAULT NULL

Developers
2008-11-03
2013-03-08
  • Angelo Dabalà

    Angelo Dabalà - 2008-11-03

    Hi Developers,

    While I was trying to import localization Colombia, and I've got an error with Oracle 11g on creating columns

    ===========> DB.executeUpdate: ALTER TABLE LCO_ISIC ADD AD_Org_ID NUMBER(10) DEFAULT  NULL  NOT NULL [SvrProcess_2b4a73c9-411c-4723-bdca-fd24cfd291bf] [11]
    java.sql.SQLException: ORA-00600: internal error code, arguments: [kkdlSetColDTypeDfltProps0], [], [], [], [], [], [], []
    ; State=60000; ErrorCode=600

    the problems seems to be the DEFAULT NULL, I tryed to issue the same command on sqldeveloper and got the same error, removing the DEFAULT NULL solved.

    I propose to change MColumn.getSQLDDL() from

            //    Default
            if (getDefaultValue() != null && getDefaultValue().length() > 0)
            {
                       ....
    to

            //    Default
            if (getDefaultValue() != null && getDefaultValue().length() > 0 && getDefaultValue().indexOf('@') == -1)
            {
                       ....

    and also remove the corresponding tests on defaultValue a few lines above because they are redundant:

                String defaultValue = getDefaultValue();
                if (defaultValue != null
                    && defaultValue.length() > 0
                    && defaultValue.indexOf('@') == -1)        //    no variables
                {

    What do you think?

    Angelo

     
    • Carlos Ruiz

      Carlos Ruiz - 2008-11-05

      Hi Angelo, yes, I saw this reported also before in 11G.
      https://sourceforge.net/forum/message.php?msg_id=5382575

      The fix must be located at MColumn.getSQLDDL.

      I suppose it's a simple fix to not write "DEFAULT NULL" when the column is mandatory.

      Regards,

      Carlos Ruiz

       

Log in to post a comment.