• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2878
  • Last Modified:

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

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
aman0711
Asked:
aman0711
  • 7
  • 5
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>trim(TXN_MEASUREMENT."datetime")

you are missing a column name for that.
0
 
aman0711Author Commented:
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
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
aman0711Author Commented:
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
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
yes
0
 
aman0711Author Commented:
Thanks :)
0
 
aman0711Author Commented:
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
 
aman0711Author Commented:
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
 
aman0711Author Commented:
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
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
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
 
aman0711Author Commented:
OH thanks :)

 I will follow this process now.

What will happen to all the changes I requested already, Angel?
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

  • 7
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now