ORA-00904: invalid column name

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Shino

    ORA-00904: invalid column name

    Hi,

    Can anyone help with this error: "ORA-00904: invalid column name"?
    Thanks!

    SQLcreate view PPFa as
    2 SELECT L.UserID AS LecID, U.Name, U.Email, I.IntakeID, S.UserID
    AS StudID
    3 FROM User_Lecturer L, User_Student S, TBL_Intake I, Users U
    4 WHERE L.UserID=S.Init ialSupervisorID And L.UserID=U.User ID And
    S.PPFState="PPF Not approved yet
    " And S.bIsActive=Tru e And S.txtIntakeID=I .IntakeID And
    Dateadd('d',S.P PF_ExtraDays,I. PPF_Lock)<now(
    ) And I.CompletionDat e>now()
    5 GROUP BY L.UserID, U.Name, U.Email, I.IntakeID, S.UserID
    6 ;
    WHERE L.UserID=S.Init ialSupervisorID And L.UserID=U.User ID And
    S.PPFState="PPF Not approved yet" And

    ERROR at line 4:
    ORA-00904: invalid column name


    Thank you and have a nice day!
  • sybrandb@yahoo.com

    #2
    Re: ORA-00904: invalid column name

    lwc7@hotmail.co m (Shino) wrote in message news:<8f16856.0 307231954.56558 4d6@posting.goo gle.com>...
    Hi,
    >
    Can anyone help with this error: "ORA-00904: invalid column name"?
    Thanks!
    >
    SQLcreate view PPFa as
    2 SELECT L.UserID AS LecID, U.Name, U.Email, I.IntakeID, S.UserID
    AS StudID
    3 FROM User_Lecturer L, User_Student S, TBL_Intake I, Users U
    4 WHERE L.UserID=S.Init ialSupervisorID And L.UserID=U.User ID And
    S.PPFState="PPF Not approved yet
    " And S.bIsActive=Tru e And S.txtIntakeID=I .IntakeID And
    Dateadd('d',S.P PF_ExtraDays,I. PPF_Lock)<now(
    ) And I.CompletionDat e>now()
    5 GROUP BY L.UserID, U.Name, U.Email, I.IntakeID, S.UserID
    6 ;
    WHERE L.UserID=S.Init ialSupervisorID And L.UserID=U.User ID And
    S.PPFState="PPF Not approved yet" And
    >
    ERROR at line 4:
    ORA-00904: invalid column name
    >
    >
    Thank you and have a nice day!

    String literals are enclosed by ' not by "
    Please consult the documentation before asking such basic questions

    Sybrand Bakker
    Senior Oracle DBA

    Comment

    • Mark D Powell

      #3
      Re: ORA-00904: invalid column name

      lwc7@hotmail.co m (Shino) wrote in message news:<8f16856.0 307231954.56558 4d6@posting.goo gle.com>...
      Hi,
      >
      Can anyone help with this error: "ORA-00904: invalid column name"?
      Thanks!
      >
      SQLcreate view PPFa as
      2 SELECT L.UserID AS LecID, U.Name, U.Email, I.IntakeID, S.UserID
      AS StudID
      3 FROM User_Lecturer L, User_Student S, TBL_Intake I, Users U
      4 WHERE L.UserID=S.Init ialSupervisorID And L.UserID=U.User ID And
      S.PPFState="PPF Not approved yet
      " And S.bIsActive=Tru e And S.txtIntakeID=I .IntakeID And
      Dateadd('d',S.P PF_ExtraDays,I. PPF_Lock)<now(
      ) And I.CompletionDat e>now()
      5 GROUP BY L.UserID, U.Name, U.Email, I.IntakeID, S.UserID
      6 ;
      WHERE L.UserID=S.Init ialSupervisorID And L.UserID=U.User ID And
      S.PPFState="PPF Not approved yet" And
      >
      ERROR at line 4:
      ORA-00904: invalid column name
      >
      >
      Thank you and have a nice day!
      Constants normally go inside sigle quotes not double quotes. If that
      is not your specific problem then take the error message at its word
      and compare your column names to the table describes.

      HTH -- Mark D Powell --

      Comment

      • Mark D Powell

        #4
        Re: ORA-00904: invalid column name

        lwc7@hotmail.co m (Shino) wrote in message news:<8f16856.0 307231954.56558 4d6@posting.goo gle.com>...
        Hi,
        >
        Can anyone help with this error: "ORA-00904: invalid column name"?
        Thanks!
        >
        SQLcreate view PPFa as
        2 SELECT L.UserID AS LecID, U.Name, U.Email, I.IntakeID, S.UserID
        AS StudID
        3 FROM User_Lecturer L, User_Student S, TBL_Intake I, Users U
        4 WHERE L.UserID=S.Init ialSupervisorID And L.UserID=U.User ID And
        S.PPFState="PPF Not approved yet
        " And S.bIsActive=Tru e And S.txtIntakeID=I .IntakeID And
        Dateadd('d',S.P PF_ExtraDays,I. PPF_Lock)<now(
        ) And I.CompletionDat e>now()
        5 GROUP BY L.UserID, U.Name, U.Email, I.IntakeID, S.UserID
        6 ;
        WHERE L.UserID=S.Init ialSupervisorID And L.UserID=U.User ID And
        S.PPFState="PPF Not approved yet" And
        >
        ERROR at line 4:
        ORA-00904: invalid column name
        >
        >
        Thank you and have a nice day!
        Ralf, if a row in Table A should only be inserted if column four of
        table A has a row with a corresponding value in tables B, C, and D
        then you would need to define 3 FK constraints on column four of Table
        A. This may or may not indicate a design problem as such a
        relationship could be valid where an interruptable process exits and
        data flows from B to C to D and a row should not be inserted into A
        until this process has completed. But it could also mean you are not
        looking at the true parent of A and are adding unnecessary FK
        constraints or that you have a non-normalized table in the chain.

        So my advice would be only declare the FK constraints if 1- the
        constraint is to a true parent and 2- it is needed to protect the
        integrity of the data

        HTH -- Mark D Powell --

        Comment

        • george lewycky

          #5
          Re: ORA-00904: invalid column name

          S.InitialSuperv isorID might be the culprit

          remove the where stmt with S.InitialSuperv isorID

          I would select this column also: InitialSupervis orID


          george

          Comment

          Working...