To check whether there is any size mismatch between columns of two tables
Hi,
Here i got two tables T and M where i am going to migrate data from T to M. But before migrating i need to check whether all the data in source table fits into destination table columns. The datatypes of all columns in source table T is of Varchar2 only as it is a temp table.
Ex :- Table 'T' (Source table) with columns
T_Lat Varchar2(50);
T_Amt Varchar2(50);
T_Cat Varchar2(50);
T_Vat Varchar2(50);
Now I have another table 'M'(Destination Table) with columns
M_Lat Varchar2(50);
M_Amt varchar2(25);
M_Cat date;
M_Vat number;
Now my task is I have to do a prevalidation of the data in 'T' that whether all the data in those columns will suit for the destination table columns respectively (to check whether there is any size mismatch). This check should be done dynamically.
For suppose, in T_Amt(source column of T table) if text is abt 50 characters, it cant fit M_Amt(destination column of M table). In this case it should throw an error indicating that destination column size is less for the source column.
Note:- There is no unique mapping column for these two tables and there are about 400 columns in the source table to be validate
I think it can be done using arrays or plsql tables.
Can any one help in this regard.