3 Replies Latest reply on Jan 14, 2016 5:11 PM by rp0428

    warning messages generated by CREATE TABLE as select

    3154198

      There is already an archived discussion(without solution) to this topic.

       

      Problem:

      SQL Developer shows a warning, but the sql has run successfully.

      Example:

      ----START
      DROP TABLE sourcetable ;
      CREATE TABLE sourcetable(col1 varchar2(80),col2 varchar2(20));
      INSERT INTO sourcetable VALUES('blsbls',null);
      commit;

      DROP TABLE customers_phone;
      CREATE TABLE customers_phone AS
      SELECT a.* --col1 as col_max
      FROM sourcetable a;

      --> Warning! Because of some null values in at least one field

      select * from customers_phone

      -- But table has been created.
      ----END

       

      Workaround: Use a parallel hint!!

       

      Example:

      ----START
      DROP TABLE sourcetable ;
      CREATE TABLE sourcetable(col1 varchar2(80),col2 varchar2(20));
      INSERT INTO sourcetable VALUES('blsbls',null);
      commit;

      DROP TABLE customers_phone;
      CREATE TABLE customers_phone AS
      SELECT /*+ parallel(2) */a.* --col1 as col_max
      FROM sourcetable a;

      --> No Warning any more!

      select * from customers_phone
      ----END