Powered By Blogger

Saturday, 5 May 2012

Find the Difference amongs the column in different tables.

INTRODUCTION

Let us suppose you have two table. One is yearly (Permanent) table and other is temporary table ( daily transaction table). If your  yearly table has 450 columns and your temporary table has 446 columns.If
you want to move temporary table data into the yearly table that time oracle give the error """"NOT ENOUGH VALUE"""". That time you  need to know which column is not present in your temporary table. For that you write the query.....


> select column_name from user_tab_columns where table_name='EMP'
   MINUS
   select column_name from user_tab_columns where table_name='EMPTEMP'

It will show 4 columns that was not present in your temporary table. you can alter the column.


""here EMP is a yearly(permanent) table and EMPTEMP is a temporary table"".

No comments: