Skip to content

MS Query and Oracle

Thomas LeahyMember for 22 years 4 months
Created
2
3
0
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

2 replies

Oldest first
  1. 0
    Mk Tse ·
    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.
  2. 0
    Forum Guest ·
    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.

Log in or join to reply

ProjectControls.com is free to join. Members can post questions, reply, vote and follow discussions.

Existing members: your original username and password still work. Forgot password?