4 Replies Latest reply on May 1, 2019 5:11 PM by Glen Conway

    Minor Bug? DDL generated when making an existing column virtual

    Mint-Innit

      Hi, I think this is a bug in versions up to and including:

       

      Version 18.3.0.277

      Build 277.2354

       

      The DDL generated when altering a column to become virtual is incorrect. e.g.

       

      Simple table

      CREATE TABLE "TEST_TABLE" 
         (    "COLUMN1" NUMBER, 
          "COLUMN2" NUMBER
         ) ;
      

       

      • Edit table in SQL Developer
      • Select column 2
      • click Data Type in edit dialog to expand column details
      • change to Virtual with expression e.g.  COLUMN1 * 100
      • Click DDL in tree view

      SQL Developer has generated the following DDL:

       

      ALTER TABLE TEST_TABLE DROP COLUMN COLUMN2;
      ALTER TABLE TEST_TABLE MODIFY ( COLUMN2 AS ( column1 * 100 ) VIRTUAL );
      ALTER TABLE TEST_TABLE ADD (COLUMN2 AS ( column1 * 100 ) VIRTUAL );
      

       

      Clicking OK fails at statement 2 of course. Clearing the error dialog and clicking OK again then works. So I guess the modify shouldn't be there.

       

      Cheers.