Results 1 to 2 of 2
  1. #1
    Join Date
    May 2005
    Posts
    54

    Unanswered: Problem creating view

    Dear All

    I'm trying to create a view but facing following errors.

    View statement is a s below:

    create view Vcashtransactions1 as
    SELECT C.EmpNo, C.Supplier, C.AccountNo, C.VoucNumber, C.VoucDate, C.ExpMonth, C.BillingMonth,
    C.Amount, C.Notes, b.grade
    FROM cashtransactions c, billinghr b
    where cashtransactions.empno=billinghr.empno;

    and the error is:

    Error starting at line 1 in command:
    create view Vcashtransactions1 as
    SELECT C.EmpNo, C.Supplier, C.AccountNo, C.VoucNumber, C.VoucDate, C.ExpMonth, C.BillingMonth,
    C.Amount, C.Notes, b.grade
    FROM cashtransactions c, billinghr b
    where cashtransactions.empno=billinghr.empno
    Error at Command Line:5 Column:29
    Error report:
    SQL Error: ORA-00904: "BILLINGHR"."EMPNO": invalid identifier
    00904. 00000 - "%s: invalid identifier"
    *Cause:
    *Action:

    Thanks.

    Wasim
    Last edited by wasim_sono; 12-16-08 at 04:45.

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Either get rid of tables' aliases, or don't use full table names in the WHERE clause (I prefer the second one).

    So, if the EMPNO column really exists in both tables, it would/should look like
    Code:
    ... WHERE c.empno = b.empno

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •