4 Replies Latest reply: Jan 31, 2013 4:53 PM by rp0428 RSS

    invalid identifier

    987899
      hello,
      i got this error :
       
      ERROR at line 6:
      ORA-00904: "NUMPROD": invalid identifier
      and this is the creation of the table:
       
      create table LIGNE_COMMANDE
      (NumProd  number(10), 
      Prix  number(11,2),
      Qtecom  number(9),
      NumCom  number(7),
      constraint pk_LICOM primary key(NumProd, NumCom),
      constraint ref_CLI 
           foreign key(NumCli) references CLIENT(NumCli),
      constraint ref_PROD 
           foreign key(NumProd) references PRODUIT(NumProd) 
      );
      thank's
        • 1. Re: invalid identifier
          Frank Kulash
          Hi,
          984896 wrote:
          hello,
          i got this error :
           
          ERROR at line 6:
          ORA-00904: "NUMPROD": invalid identifier
          and this is the creation of the table:
           
          create table LIGNE_COMMANDE
          (NumProd  number(10), 
          Prix  number(11,2),
          Qtecom  number(9),
          NumCom  number(7),
          constraint pk_LICOM primary key(NumProd, NumCom),
          constraint ref_CLI 
               foreign key(NumCli) references CLIENT(NumCli),
          constraint ref_PROD 
               foreign key(NumProd) references PRODUIT(NumProd) 
          );
          Are you sure this is the command you're running?
          I don't get any error concerning NumProd, but I do get a similar message:
          ...     foreign key(NumCli) references CLIENT(NumCli),
                           *
          ERROR at line 8:
          ORA-00904: "NUMCLI": invalid identifier
          because you haven't defined a column in ligne_commande called NumCli.

          When you said Num<b>Cli</b>, did you mean Num<b>Com</b>?

          If NumCli is a separate column, you have to define it before you constrain it:
          create table LIGNE_COMMANDE
          (NumProd  number(10), 
          Prix  number(11,2),
          Qtecom  number(9),
          NumCom  number(7),
          NumCli     number (10),                    -- *****  NEW  *****
          constraint pk_LICOM primary key(NumProd, NumCom),
          constraint ref_CLI 
               foreign key(NumCli) references CLIENT(NumCli),
          constraint ref_PROD 
               foreign key(NumProd) references PRODUIT(NumProd) 
          );
          • 2. Re: invalid identifier
            sb92075
            Handle:     984896
            Status Level:     Newbie
            Registered:     Jan 29, 2013
            Total Posts:     8
            Total Questions:     4 (4 unresolved)


            How do I ask a question on the forums?
            SQL and PL/SQL FAQ
            • 3. Re: invalid identifier
              987899
              Yes it's NUMCOM not NUMCLI, but i have the same error message about NumProd
              • 4. Re: invalid identifier
                rp0428
                >
                foreign key(NumProd) references PRODUIT(NumProd)
                >
                Is 'NUMPROD' the actual name of a column in the PRODUIT table that has a unique constraint/primary key defined on it?