My query is missing, the alter number and by default... How can I fixed.

USER_ A



create table TBL_A (FIELD_A1 number not null,

FIELD_A2 varchar2 (50).

Date of FIELD_A3,

FIELD_A4 number (5.2) default 0,

FIELD_A5 varchar2 (10) not null

);


USER_B

create table TBL_A (FIELD_A1 number not null,

FIELD_A2 varchar2 (20).

FIELD_A4 number (5.2) not null,

FIELD_A5 varchar2 (10),

FIELD_A6 number (2) not null

);

I see the result as below after running under query only the error is the second line, and the rest is correct, then how can I correct second line? :

ALTER table TBL_A change FIELD_A5 VARCHAR2 (10) not null

alter table TBL_A change FIELD_A4 ISSUE 5, 2) null / / want to see only this one as alter table TBL_A change FIELD_A4 NUMBER (5.2), default value 0, the rest is OK!

ALTER table TBL_A change FIELD_A2 VARCHAR2 null (50)

change the table TBL_A FIELD_A6 fall

ALTER table TBL_A add DATE of FIELD_A3

MYQUERY:

with the CBC as

(

Select src.table_name src_table_name, src.column_name src_col_name, src.data_type src_data_type, src.data_length src_data_len, src.data_precision src_data_precision, src.data_scale src_data_scale,

CBC. Nullable src_nullable, decode (T.Constraint_Type, 'P', 'Primary Key', 'U', 'Unique', ") as src_cons

all_tab_columns CBC

left join (select Cc.Column_Name, Uc.Constraint_Type

of user_cons_columns cc, uc user_constraints

where Cc.Constraint_Name = Uc.Constraint_Name

and Cc.Table_Name = Uc.Table_Name) t

on T.Column_Name = Src.Column_Name

where table_name = 'TBL_A' and owner = 'USER_A '.

),

As TGT

(

Select tgt.table_name tgt_table_name, tgt.column_name tgt_col_name, tgt.data_type tgt_data_type, tgt.data_length tgt_data_len,

TGT.data_precision tgt_data_precision, tgt.data_scale tgt_data_scale, tgt.nullable tgt_nullable,

Decode (T.Constraint_Type, 'P', 'Primary Key', 'U', 'Unique', ") as tgt_cons

from all_tab_columns tgt

left join (select Cc.Column_Name, Uc.Constraint_Type

of user_cons_columns cc, uc user_constraints

where Cc.Constraint_Name = Uc.Constraint_Name

and Cc.Table_Name = Uc.Table_Name) t

on T.Column_Name = TGT. Column_Name

where table_name = 'TBL_A' and owner = 'USER_B '.

),

col_details as

(

Select src.src_table_name, nvl (tgt.tgt_table_name, first_value (tgt_table_name) more (order of nulls last tgt_table_name)) tgt_table_name;

SRC.src_col_name, src.src_data_type, src.src_data_len, src.src_data_precision, src.src_data_scale, src.src_nullable, src_cons,

TGT.tgt_col_name, tgt.tgt_data_type, tgt.tgt_data_len, tgt.tgt_data_precision, tgt.tgt_data_scale, tgt.tgt_nullable, tgt_cons

the CBC

outer join full tgt

on)

SRC.src_col_name = tgt.tgt_col_name

)

)

Select *.

de)

Select the case sensitive option

When tgt_data_type! = src_data_type or tgt_data_len! = src_data_len or tgt_data_precision! = src_data_precision or tgt_data_scale! = src_data_scale or tgt_nullable! = src_nullable

then 'alter table ' | tgt_table_name | 'Edit ' | tgt_col_name | ' ' || src_data_type | ' ' ||

-case when src_data_type null ('DATE') then

on the other

case

When src_data_type in ('VARCHAR', 'VARCHAR2')

then ' (' |) NVL (to_char (src_data_len), ' ') | ') '

otherwise decode (nvl (src_data_precision-1),-1, null, nvl (to_char (src_data_precision), ' ') |) ', ' || NVL (to_char (src_data_scale), ' ') | ')')

end

end

||

cases where src_nullable = 'Y' then 'null '.

of another end 'not null '.

|| tgt_cons

When tgt_col_name is null

then 'alter table ' | tgt_table_name | 'Add ' | src_col_name | ' ' ||  ' ' || ' ' || src_data_type | ' ' ||

-case when src_data_type null ('DATE') then

on the other

case

When src_data_type in ('VARCHAR', 'VARCHAR2')

then ' ('| nvl (to_char (src_data_len), ' ') |) ') '

otherwise decode (nvl (src_data_precision-1),-1, null, nvl (to_char (src_data_precision), ' ') |) ', ' || NVL (to_char (src_data_scale), ' ') | ')')

end

end

|| tgt_cons

When src_col_name is null

then 'alter table' | tgt_table_name: ' drop '. tgt_col_name

end alter_statement

of col_details

)

where alter_statement is not null;

DBMS_METADATA_DIFF is first 11.1.0.7 available version. Your version is 11.1.0.6

You cannot install this package to your version, because this package is packed.

You can do this:

1. export the diagrams with EXPDP without data.

2 import the schemas to the new database version 11.2.

3. use the DBMS_METADATA_DIFF package for your condition.

4. take change script and use the database version 11.1

Concerning

Mr. Mahir Quluzade

http://www.Mahir-quluzade.com

Tags: Database

Similar Questions

Maybe you are looking for