Solved

ORA-00998: must name this expression with a column alias

Posted on 2009-05-11
13
2,443 Views
Last Modified: 2013-12-07
Hi experts,

             I am getting the error ORA-00998 on attempting to create the following table.
CREATE TABLE SUMMARY AS
select AG1."a_id", S1."s_id", AG1."i_id",
trim(TX1."datetime") , TX2."delta_msec", TX3."del_u",
TX4."con", P1."p_id"
from
AG1, S1, TX1, TX2, 
TX3, P1

Open in new window

0
Comment
Question by:aman0711
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 5
13 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 24359420
>trim(TXN_MEASUREMENT."datetime")

you are missing a column name for that.
0
 
LVL 10

Author Comment

by:aman0711
ID: 24359459
hi angell,

                       Please forgive if I am asking too many dumb question. i am very new to this and trying to learn.

   I just put an extra trim for TXN_MEASUREMENT."datetime"

my other columns are like SLOT_META_DATA."slot_id" ... why it claims for a column when I am using datetime
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 24359469
I presume you actually want to TRUNC() instead of TRIM(), but that's you to clarify what you need.

the ora error you get can be solved like this:
CREATE TABLE SUMMARY AS
select AG1."a_id", S1."s_id", AG1."i_id",
trim(TX1."datetime") "datetime" , TX2."de_m", TX3."del_u",
TX4."con", P1."p_id"
from
AG1, S1, TX1, TX2, 
TX3, P1

Open in new window

0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
LVL 10

Author Comment

by:aman0711
ID: 24359565
Thanks angel :)

 Actually there was lot of white space in that particular column, so I was trying to trim it up.

Please correct me if I am wrong:-

after using the trim function on a column, I have to again the declare the column name like you did:
trim(TXN_MEASUREMENT."datetime") "datetime

right?
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 24361257
yes
0
 
LVL 10

Author Closing Comment

by:aman0711
ID: 31580341
Thanks :)
0
 
LVL 10

Author Comment

by:aman0711
ID: 25852840
Code to be replaced in the question body:



CREATE TABLE SUMMARY AS
select AG1."a_id", S1."s_id", AG1."i_id",
trim(TX1."datetime") , TX2."delta_msec", TX3."del_u",
TX4."con", P1."p_id"
from
AG1, S1, TX1, TX2, 
TX3, P1

Open in new window

0
 
LVL 10

Author Comment

by:aman0711
ID: 25852848
Morphed code for ID: 24359469

CREATE TABLE SUMMARY AS
select AG1."a_id", S1."s_id", AG1."i_id",
trim(TX1."datetime") "datetime" , TX2."de_m", TX3."del_u",
TX4."con", P1."p_id"
from
AG1, S1, TX1, TX2, 
TX3, P1

Open in new window

0
 
LVL 10

Author Comment

by:aman0711
ID: 25854732
Hi Angel,

                Thanks for helping me out with this issue. Your comment made me confused here, I was actually following the way you are suggesting to edit a question (Post code in the Request Attention page ), but then I was told that, thats the wrong way of doing it and I have to post the code here itself.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 25854901
As you where told here:
http://www.experts-exchange.com/Community_Support/General/Q_24904088.html

>Usually, you go into the related question, and press "Request Attention" there (exclamation mark button). This provides us with the link to this question.

in the RA text, you say you want to change some code snippets
you will find the relevant CS question here (in your profile):
http://www.experts-exchange.com/QH_4650528.html

you can then there post the "new" code.

a3
0
 
LVL 10

Author Comment

by:aman0711
ID: 25855001
OH thanks :)

 I will follow this process now.

What will happen to all the changes I requested already, Angel?
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 25855051
you have indeed requested plenty of those.
from what I read in the admin comments of those questions, they will be processed.
one by one.

you really put a lot of work for the admins last night ... ;/

a3
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question