Print Thread
Compare user objects: varchar2(xx char) not used in correct way
#60472 08/29/19 03:21 PM
Joined: Dec 2005
Posts: 132
Leoben,Austria
D
Member
OP Offline
Member
D
Joined: Dec 2005
Posts: 132
Leoben,Austria
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

Re: Compare user objects: varchar2(xx char) not used in correct way
Dezsoe Kados #60474 08/30/19 09:13 AM
Joined: Aug 1999
Posts: 22,206
Member
Offline
Member
Joined: Aug 1999
Posts: 22,206
Can you let me know the table creation DDL in both the source and target schema?


Marco Kalter
Allround Automations
Re: Compare user objects: varchar2(xx char) not used in correct way
Marco Kalter #60475 09/01/19 08:07 AM
Joined: Dec 2005
Posts: 132
Leoben,Austria
D
Member
OP Offline
Member
D
Joined: Dec 2005
Posts: 132
Leoben,Austria
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

Re: Compare user objects: varchar2(xx char) not used in correct way
Dezsoe Kados #60476 09/02/19 08:31 AM
Joined: Aug 1999
Posts: 22,206
Member
Offline
Member
Joined: Aug 1999
Posts: 22,206
Thanks. We'll investigate.


Marco Kalter
Allround Automations

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.033s Queries: 14 (0.008s) Memory: 2.5064 MB (Peak: 3.0395 MB) Data Comp: Off Server Time: 2024-04-29 01:16:56 UTC
Valid HTML 5 and Valid CSS