ORA-00972: identifier is too long.
Till Oracle 12 C, the identifier length is 30 characters. Starting from 18 C Oracle increased the length of identifier to 128 character. So now we can define our identifiers till 128 characters if you have upgraded to 18 C.
Let see one example.
Database version 18 C.
Select ename as "ename asaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaassssssssssssssssssssssssssssssssssssssssss
ssssssssssssssssssssssssssssssssssssssssssssss",
length ('ename asaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaassssssssssssssssssssssssssssssssssssssssssssssssss
ssssssssssssssssssssssssssssssssssssss') from emp
In the above example, the alias length is 128 characters and the query is executing successfully. Now try to add one more character in the alias.
Select ename as "ename asaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaassssssssssssssssssssssssssssssssssssssssss
ssssssssssssssssssssssssssssssssssssssssssssssA",
length ('ename asaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaassssssssssssssssssssssssssssssssssssssssssssssssss
ssssssssssssssssssssssssssssssssssssssA') from emp
Database version vise identifier length
- Database: 12c Release 1
Description: identifier is too long
Cause: An identifier with more than 30 characters was specified.
Action: Specify at most 30 characters.
- Database: 10g Release 1
Description: identifier is too long
Cause: An identifier with more than 30 characters was specified.
Action: Specify at most 30 characters.
- Database: 10g Release 2
Description: identifier is too long
Cause: An identifier with more than 30 characters was specified.
Action: Specify at most 30 characters.
- Database: 11g Release 1
Description: identifier is too long
Cause: An identifier with more than 30 characters was specified.
Action: Specify at most 30 characters.
- Database: 11g Release 2
Description: identifier is too long
Cause: An identifier with more than 30 characters was specified.
Action: Specify at most 30 characters.
- Database: 12c Release 2
Description: identifier is too long
Cause: An identifier with more than 30 characters was specified.
Action: Specify at most 30 characters.
- Database: 18c Release 1
Description: identifier is too long
Cause: An identifier with more than 128 bytes was specified, or a password identifier longer than
30 bytes was specified.
Action: Specify at most 128 bytes for identifiers, and at most 30 bytes for password identifiers.
- Database: 19c Release 1
Description: identifier is too long
Cause: An identifier with more than 128 bytes was specified, or a password identifier longer than
30 bytes was specified.
Action: Specify at most 128 bytes for identifiers, and at most 30 bytes for password identifiers.
References:
https://docs.oracle.com/en/database/oracle/oracle-database/index.html