Compare user objects: varchar2(xx char) not used in correct way

Dezsoe Kados

Member³
When comparing (and applying after compare...) tables the varchar2 are always compared with byte semantics. This seems to be wrong.

Version: 13.0.6.1911

Dezs
 
The simplest example:

on the source:

CREATE TABLE tab1 (testcol VARCHAR2(10 CHAR));

SELECT table_name,data_type,char_length,char_used FROM user_tab_columns WHERE table_name='TAB1';

TABLE_NAME DATA_TYPE CHAR_LENGTH CHAR_USED
1 TAB1 VARCHAR2 10 C

compare to target (the table does not exist on target) and apply ...

check the result of the apply on the target

SELECT table_name,data_type,char_length,char_used FROM user_tab_columns WHERE table_name='TAB1';

TABLE_NAME DATA_TYPE CHAR_LENGTH CHAR_USED
1 TAB1 VARCHAR2 10 B

"nls_length_semantics = CHAR" on both databases involved.

Both databases are version 12.1.0.2.0

Seems that the apply does not use the "VARCHAR2(10 CHAR)" clause to enforce this.
Also the compare should "see" "VARCHAR2(10)" and "VARCHAR2(10 CHAR)" as difference
 
Back
Top