oracle tutorial webinars

ORA-00972

ORA-00972 is related to a simple syntax convention that concerns identifiers within Oracle. While fixing the error is rather simple, the following information about identifiers is important to know in order to understand how to name and use identifiers throughout your code.

Each database object is represented by an identifier. This can either be a quoted identifier or nonquoted identifier. If it is a quoted identifier, it must begin and end with double quotation marks. Whenever you refer to this object anywhere else in the code, you must include it within the double quotation marks to ensure that the code runs correctly. A nonquoted identifier does not require double quotation marks, but is written as is. In either case, the names must be 30 characters or less. The only exceptions to this rule are that the names of databases can only be 8 characters long and the names of database links can only be 128 characters long.

Reserved words in Oracle cannot be used with nonquoted identifiers while quoted identifers can be reserved words. However, the latter is not a good practice and should be avoided. Reserved words have a special meaning in Oracle and therefore should not be utilized in this manner as it may cause confusion for the user and prompt errors when running the code. To ensure that you do not face difficulties with these words, it is best not to use reserved words. There is a list that details all of Oracle’s reserved words for reference.

The Problem

When faced with ORA-00972, you will see the following error message:

ORA-00972: identifier is too long

You have tried to reference a table, cluster, view, index, synonym, tablespace, or username with a value that is longer than 30 characters. As previously stated, identifiers must be no longer than 30 characters. Since you did not follow this naming guideline, it prompted ORA-00972.

The Solution

To resolve the error, simply rename the value to ensure that it is 30 characters or less. This should solve the problem and get rid of the error message.

Looking Forward

Fortunately, errors concerning Oracle syntax like ORA-00972 are rather easy to fix. In order to avoid seeing such errors in the future, be sure to become familiar with the rules related to naming schemas in Oracle. While these types of errors may be simple fixes, it is best to avoid them altogether. Knowing and following the syntactical rules of Oracle and reading through official Oracle documentation concerning this topic can reduce the possibility of seeing ORA-00972.

If you continue to have problems with this or any other error, you may want to contact your database administrator or a licensed Oracle consultant to help resolve the issue. Check your consultant’s licensing and experience to be sure that your Oracle needs will be met properly.