Guild of Project Controls: Compendium | Roles | Assessment | Certifications | Membership

Tips on using this forum..

(1) Explain your problem, don't simply post "This isn't working". What were you doing when you faced the problem? What have you tried to resolve - did you look for a solution using "Search" ? Has it happened just once or several times?

(2) It's also good to get feedback when a solution is found, return to the original post to explain how it was resolved so that more people can also use the results.

MS Query and Oracle

2 replies [Last post]
Thomas Leahy
User offline. Last seen 8 years 14 weeks ago. Offline
Joined: 9 Jun 2004
Posts: 11
Groups: None
Hello,
In MS Query when I run the following:
Create view tal_contractor_rsrc as
SELECT d.PROJ_ID, d.PROJ_SHORT_NAME, c.TASK_CODE, c.TASK_NAME, c.TASK_TYPE, c.PHYS_COMPLETE_PCT, c.TARGET_DRTN_HR_CNT, c.REMAIN_DRTN_HR_CNT, c.ACT_START_DATE, c.ACT_END_DATE, c.EARLY_START_DATE, c.EARLY_END_DATE, a.RSRC_SHORT_NAME, a.RSRC_NAME, Sum(b.ACT_REG_COST) as T_Act_Reg_Cost, Sum(b.ACT_THIS_PER_COST) as T_Act_This_Per_Cost, Sum(b.REMAIN_COST) as T_Remain_Cost, Sum(b.TARGET_COST) as T_Target_Cost
FROM rsrc a, taskrsrc b, task c, project d
WHERE a.RSRC_ID = b.RSRC_ID AND b.PROJ_ID = c.PROJ_ID AND b.TASK_ID = c.TASK_ID AND c.PROJ_ID = d.PROJ_ID AND ((b.RSRC_ID=3920))
GROUP BY d.PROJ_ID, d.PROJ_SHORT_NAME, c.TASK_CODE, c.TASK_NAME, c.TASK_TYPE, c.PHYS_COMPLETE_PCT, c.TARGET_DRTN_HR_CNT, c.REMAIN_DRTN_HR_CNT, c.ACT_START_DATE, c.ACT_END_DATE, c.EARLY_START_DATE, c.EARLY_END_DATE, a.RSRC_SHORT_NAME, a.RSRC_NAME

I get the error message ORA-00998: must name this expression with a column alias.

For the life of me I cannot see what column it is that is causing the problem.

Regards,
Tom Leahy

Replies

Forum Guest
User offline. Last seen 2 years 28 weeks ago. Offline
Joined: 28 Jan 2009
Posts: 1
Groups: None
Try running this script at the Oracle SQL prompt

SQL > Create view tal_contractor_rsrc as
SELECT etc etc....

you will then get the error message appearing which will point out on which line the error has occured and at which character, alternatively if you have Oracle procedure builder run the query in there and use the built in de bugging editor.

All of the Oracle software can be downloaded for free to be used for evaluation etc.

Also why not post this query to Oracle themselves.
MK TSE
User offline. Last seen 3 years 47 weeks ago. Offline
Joined: 27 Feb 2002
Posts: 550
Groups: None
Some fields must be named. I think the following have problem "...Sum(b.ACT_REG_COST) as T_Act_Reg_Cost, Sum(b.ACT_THIS_PER_COST) as T_Act_This_Per_Cost, Sum(b.REMAIN_COST) as T_Remain_Cost, Sum(b.TARGET_COST) as T_Target_Cost..."
Give a name to these columns.
Field: X: sum(b.ACT_REG_COST)
Table: BLANK
Total: Expression
Criterial: BLANK

If you want to add selection criterial, add one more column with Total is "where" and in hidden mode.