Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ORA-00972 identifier is too long alias column name

Tags:

alias

sql

oracle

i have a query like :

SELECT column as averyveryveryverylongalias (more than 30 characters)    FROM Table_name 

it returns the error ORA-00972 identifier is too long , is there any tip to make it work without making the alias shorter?

Thanks

like image 247
mcha Avatar asked Jun 21 '10 14:06

mcha


People also ask

What does Identifier too long?

If you're running an SQL statement that refers to another database object (table, view, sequence, synonym, and so on), you might get this error: ORA-00972: identifier is too long. This error occurs because the object's name is longer than 30 characters.

What is an Oracle identifier?

An identifier is the representation within the language of items created by the user, as opposed to language keywords or commands. Some identifiers stand for dictionary objects, which are the objects you create- such as tables, views, indexes, columns, and constraints- that are stored in a database.

What is identifier in SQL?

An SQL identifier is the name of a database object. The following objects are examples of SQL identifiers: Parts of the database schema such as tables, columns, views, indexes, synonyms, and stored procedure names.


1 Answers

No, prior to Oracle version 12.2, identifiers are not allowed to exceed 30 characters in length. See the Oracle SQL Language Reference.

However, from version 12.2 they can be up to 128 bytes long. (Note: bytes, not characters).

like image 97
Tony Andrews Avatar answered Sep 27 '22 18:09

Tony Andrews