ORA-00998: must name this expression with a column aliasThis error is typical of a situation where you are attempting to create a view without specifying the column names after the view name, but you are relying on the column name or the column alias specified in the query, as in this example:
CREATE VIEW test_v ASThe error is easily fixed as follows:
SELECT owner || '.' || table_name
FROM all_tables
WHERE owner = USER;
ORA-00998: must name this expression with a column alias
CREATE OR REPLACE VIEW test_v ASor in this other equivalent way:
SELECT owner || '.' || table_name AS qualified_table_name
FROM all_tables
WHERE owner = USER;
CREATE OR REPLACE VIEW test_v (qualified_table_name)If the view is based mostly on expressions the first approach could be faster or less error prone because you can control the association between the expression and the column name more directly (or so it looks to me...).
AS
SELECT owner || '.' || table_name
FROM all_tables
WHERE owner = USER;
See message translations for ORA-00998 and search additional resources.
ORA-00998: fornire un nome a questa espressione con uno pseudonimo di colonna
ORA-00998: debe proporcionar un nombre a esta expresión con un alias de columna
ORA-00998: s'ha d'anomenar aquesta expressió amb un àlies de columna
ORA-00998: il faut nommer cette expression avec un libellé de colonne
ORA-00998: Dieser Ausdruck braucht einen Spalten-Alias
ORA-00998: πρέπει να ονομάσετε αυτή την έκφραση με ψευδώνυμο στήλης
ORA-00998: dette udtryk skal navngives med et kolonnealias
ORA-00998: uttrycket måste ges ett kolumnalias
ORA-00998: dette uttrykket må navngis med et kolonnealias
ORA-00998: tälle lausekkeelle on annettava sarakealias
ORA-00998: a kifejezéshez meg kell adni egy oszlop átnevezést
ORA-00998: această expresie trebuie numită cu un alias de coloană
ORA-00998: Deze uitdrukking moet een kolomalias hebben.
ORA-00998: esta expressão deve ser nomeada com um apelido de coluna
ORA-00998: tem que dar um nome a esta expressão com um pseudónimo de coluna
ORA-00998: Вы должны присвоить имя этому выражению, задав псевдоним столбца
ORA-00998: tento výraz je třeba pojmenovat alternativním jménem sloupce
ORA-00998: tento výraz musí mať stĺpcový alias
ORA-00998: wyrażenie to musi być nazwane z użyciem aliasu kolumny
ORA-00998: bu ifade bir sütun diğer adı ile adlandırılmalıdır
ORA-00998: must name this expression with a column alias
2 comments:
Hi Flavio,
create view test_v as
select * from (
SELECT owner || '.' || table_name
FROM all_tables
WHERE owner = USER
);
hehe
http://marogel.wordpress.com/2012/01/27/workaround-for-ora-00998-must-name-this-expression-with-a-column-alias/
Hi Sokrates,
the good news is in that if you exceed the 30 character limit for the column name, you'll get ORA-01948, so you cannot create a column containing more than 30 characters of junk ;-)
Cheers
Flavio
Post a Comment