Maximum length of VARCHAR2 no longer hard-coded!
CREATE OR REPLACE PACKAGE pkg
AUTHID DEFINER
IS
c_max_length constant integer := 32767;
SUBTYPE maxvarchar2 IS VARCHAR2 (c_max_length);
END;
Package created.
DECLARE
l_big_string1 VARCHAR2 (pkg.c_max_length) := 'So big....';
l_big_String2 pkg.maxvarchar2 := 'So big via packaged subtype....';
l_half_big VARCHAR2 (pkg.c_max_length / 2) := 'So big....';
BEGIN
DBMS_OUTPUT.PUT_LINE (l_big_string1);
DBMS_OUTPUT.PUT_LINE (l_big_string2);
END;
So big....
So big via packaged subtype....