Sergei.Agalakov
Member²
PL/SQL Developer 7.1.5 uses CHAR semantics in description of VARCHAR2 based table columns by default, and shows non-default used semantics but always uses BYTE semantics for the string based parameters to stored procedures, functions etc.
Consider example in AL32UTF8 database:
Create package test1_pck
is
SUBTYPE VARCHAR_1_TEST1 IS VARCHAR2(1 byte);
SUBTYPE VARCHAR_1_TEST2 IS VARCHAR2(1 char);
end test1_pck;
Create procedure test1_prc ( P1 IN TEST1_PCK.VARCHAR_1_TEST1) as begin null; end;
Create procedure test2_prc ( P1 IN TEST1_PCK.VARCHAR_1_TEST2) as begin null; end;
Select ua.object_name,
ua.argument_name,
ua.data_length,
ua.char_length,
ua.char_used
from user_arguments ua
where ua.object_name in ('TEST1_PRC','TEST2_PRC');
-- compare with
Drop table TEST1 purge;
Create table TEST1 (c1 varchar2(10 byte), c2 varchar2( 10 char));
Select utc.table_name,
utc.column_name,
utc.data_length,
utc.char_length,
utc.char_used
from user_tab_columns utc
where utc.table_name = 'TEST1';
For table columns that use CHAR semantics will be used length in chars when was used CHAR semantics but PL/SQL Developer always shows length in bytes for stored procedure's parameters independently from the used semantics.
It has to be consistent with the presentation of table column types.
Consider example in AL32UTF8 database:
Create package test1_pck
is
SUBTYPE VARCHAR_1_TEST1 IS VARCHAR2(1 byte);
SUBTYPE VARCHAR_1_TEST2 IS VARCHAR2(1 char);
end test1_pck;
Create procedure test1_prc ( P1 IN TEST1_PCK.VARCHAR_1_TEST1) as begin null; end;
Create procedure test2_prc ( P1 IN TEST1_PCK.VARCHAR_1_TEST2) as begin null; end;
Select ua.object_name,
ua.argument_name,
ua.data_length,
ua.char_length,
ua.char_used
from user_arguments ua
where ua.object_name in ('TEST1_PRC','TEST2_PRC');
-- compare with
Drop table TEST1 purge;
Create table TEST1 (c1 varchar2(10 byte), c2 varchar2( 10 char));
Select utc.table_name,
utc.column_name,
utc.data_length,
utc.char_length,
utc.char_used
from user_tab_columns utc
where utc.table_name = 'TEST1';
For table columns that use CHAR semantics will be used length in chars when was used CHAR semantics but PL/SQL Developer always shows length in bytes for stored procedure's parameters independently from the used semantics.
It has to be consistent with the presentation of table column types.