Posted 6/15/2010 9:40:11 AM
|
|
|
|
ORA-00998: must name this expression with a column alias This 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 AS SELECT owner || '.' || table_name FROM all_tables WHERE owner = USER;
ORA-00998: must name this expression with a column alias The error is easily fixed as follows:
CREATE OR REPLACE VIEW test_v AS SELECT owner || '.' || table_name AS qualified_table_name FROM all_tables WHERE owner = USER; or in this other equivalent way: CREATE OR REPLACE VIEW test_v (qualified_table_name) AS SELECT owner || '.' || table_name FROM all_tables WHERE owner = USER;
|
|
Posted 6/15/2010 9:42:34 AM
|
|
|
|
|
|
Posted 6/15/2010 9:42:51 AM
|
|
|
|
CREATE OR REPLACE VIEW PARTNER_SUMMARY_SEEMORE_VW AS SELECT PARTNER, TO_CHAR (SUM(TOTAL)) as TOTAL, TO_CHAR (SUM(ORG_SENT)) as ORG_SENT, TO_CHAR (SUM(ORG_RECEIVED)) as ORG_RECEIVED, TO_CHAR (SUM(TAX_RTN_PROCESSED)) as TAX_RTN_PROCESSED, TO_CHAR (SUM(TAX_RTN_REVIEWED)) as TAX_RTN_REVIEWED, TO_CHAR (SUM(TAX_RTN_SENT_TO_TAXPAYER)) as TAX_RTN_SENT_TO_TAXPAYER, office_name as office_name, TO_CHAR(NULL) some_head FROM PARTNER_SUMMARY_VW GROUP BY partner,office_name UNION ALL SELECT total_text, force_bold_fn(a) as a, force_bold_fn(TOTAL_ORG_SENT) as TOTAL_ORG_SENT, force_bold_fn(TOTAL_ORG_RECEIVED) as TOTAL_ORG_RECEIVED, force_bold_fn(TOTAL_ORG_PROCESS) as TOTAL_ORG_PROCESS, force_bold_fn(TOTAL_ORG_REVIEW) as TOTAL_ORG_REVIEW, force_bold_fn(TOTAL_ORG_CLIENT) as TOTAL_ORG_CLIENT, TO_CHAR(NULL), force_bold_fn(TOTAL_ORG_PARTNER) as TOTAL_ORG_PARTNER FROM gts_totals_vw
you need to give a column header as I gave.. replace it with your name..
|
|
Posted 6/15/2010 9:43:35 AM
|
|
|
|
create table mebs_temp10 tablespace mebs_tempt nologging as SELECT TRUNC(meddate) as meddate, ctype , btext btext, COUNT (1), sum(duration/60), SUM (bamount) FROM mells.hcalls WHERE meddate >= '01-JAN-2009' and meddate < ' GROUP BY meddate, ctype, btext * ERROR at line 1: ORA-00998: must name this expression with a column alias
I tried giving a alias for the columns ctype , btext .. but helpless. which column to be aliased ?
|
|
Posted 6/15/2010 9:43:48 AM
|
|
|
|
Try this...
create table mebs_temp10 tablespace mebs_tempt nologging as SELECT TRUNC(meddate) as meddate, ctype, btext btext, COUNT (1) count_field, sum(duration/60) sum_duration, SUM (bamount) sum_bamount FROM mells.hcalls WHERE meddate >= '01-JAN-2009' and meddate < ' GROUP BY meddate, ctype, btext
|
|
Posted 6/15/2010 9:44:12 AM
|
|
|
|
Oracle Error :: ORA-00998must name this expression with a column alias CauseAn expression or function was used in a CREATE VIEW statement, but no corresponding column name was specified. When expressions or functions are used in a view, all column names for the view must be explicitly specified in the CREATE VIEW statement. ActionEnter a column name for each column in the view in parentheses after the view name.
|
|
|
|