From Oracle 12.2 on, table names and a lot of other identifiers change their maximum length from VARCHAR2(30)
to VARCHAR2(128)
, as mentioned f.i. here.
We have tons of scripts, stored procedures and tables that refer to table names, column names etc, for instance for housekeeping purposes (copy tables, drop partitions, etc etc).
EDIT: They need to be changed so they will continue to work once the first longer name appears. I think this will probably take some time as people are so used to the short names, but it is safe to assume that it will happen at some stage.
The proper way would probably be to change from
CREATE OR REPLACE PROCEDURE myprocedure(pname VARCHAR2) IS
tabname VARCHAR2(30);
colname VARCHAR2(30);
idxname VARCHAR2(30);
BEGIN
tabname := pname;
END myprocedure;
/
to
CREATE OR REPLACE PROCEDURE myprocedure(pname VARCHAR2) IS
tabname USER_TABLES.TABLE_NAME%TYPE;
colname USER_TAB_COLUMNS.COLUMN_NAME%TYPE;
idxname USER_INDEXES.INDEX_NAME%TYPE;
BEGIN
tabname := pname;
END myprocedure;
/
But what to do about tables? The only idea I could find is a disabled foreign key, but that seems to be evil (besides, I can't even get the privileges right):
CREATE TABLE mytable (
table_name REFERENCES USER_TABLES(TABLE_NAME) DISABLE
);
Any help appreciated.