Thursday, September 22, 2016

INCONSISTENT COLUMN DATATYPE


  •  

    Inconsistent Column Names

    INCONSISTENT COLUMN DATATYPE NOTES:
  • Owner - Owner of the table
  • Column - Name of the column
  • Table Name - Name of the table
  • Datatype - Datatype of the column

    select  OWNER,
     COLUMN_NAME,
     TABLE_NAME,
     decode(DATA_TYPE, 'NUMBER', DATA_PRECISION, DATA_LENGTH) datatype
    from  dba_tab_columns 
    where   (COLUMN_NAME, OWNER) in
      (select COLUMN_NAME, 
       OWNER
        from  dba_tab_columns
        group by COLUMN_NAME, OWNER
         having min(decode(DATA_TYPE, 'NUMBER', DATA_PRECISION, DATA_LENGTH)) <
        max(decode(DATA_TYPE, 'NUMBER', DATA_PRECISION, DATA_LENGTH)) )
    and  OWNER not in ('SYS', 'SYSTEM')
    order by COLUMN_NAME,DATA_TYPE 
    

  • No comments:

    Post a Comment

    How To Fix Hive – Partition Table Query Failed When Stored As Parquet

    This article is about the bug in Hive filtering option, when the partition table query stored as parquet. Big data developers will help y...