Wrong column size detection on varchar2 fields with char as datatype

Description

Hi,

currently we are facing often the problem, that our call with diff or generateChangeLog outputs the wrong size of varchar2 columns on oracle.
This happens, if you create a table with ex. "varchar2(30 CHAR)" and you define your table/schema with utf8 charset. The each varchar2 has 30 Characters OR 4x30=120 Byte to store. But if you generate a diff, you will get an output "VARCHAR2(120 CHAR)" which ist wriong.
The problem is the usage of the wrong jdbc parameter. If a varchar2 column is defined with bytes, than you can take DATA_LENGTH, but if you define the column with CHAR you need to use CHAR_LENGTH.

A first fix, which works well, is attached.

Environment

Windows, oracle 11g

Reporter

Sven Rega

Components

Fix versions

Affects versions

Priority

Major
Configure