1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Create table : ORA-00904: invalid identifier

Discussion in 'SQL PL/SQL' started by atsadang, Jan 27, 2011.

  1. atsadang

    atsadang Guest

    Hi.. I ahve a question here when create table using script follow.. I getting error: ORA-00904: invalid identifier

    Code (SQL):

    CREATE TABLE CFJH99ATM1STUSETEMP
    (
      CUST_ID         VARCHAR2(20)              NOT NULL,
      CUST_NAME    VARCHAR2(29)              NOT NULL,
      CARD_NO        VARCHAR2(16)              NOT NULL,
      ACCT_NO        VARCHAR2(15)              NOT NULL,
      TRANDT          VARCHAR2(11)              NOT NULL,
      TRANTM         VARCHAR2(8)                NOT NULL,
      TRAN_PLACE   VARCHAR2(40)              NOT NULL,
      TRAN_TYPE     VARCHAR2(7)               NOT NULL,
      PAYAMT          NUMBER(18,2)              NOT NULL,
    );

     CREATE UNIQUE INDEX CFJH99ATM1STUSETEMP_PK ON CFJH99ATM1STUSETEMP
     (CUST_ID);

     
    The column names used looks fine, so what might go wrong for the script?

    Thanks a lot..
     
  2. Sadik

    Sadik Community Moderator Forum Guru

    Messages:
    1,906
    Likes Received:
    252
    Trophy Points:
    1,455
    You seem to have an extra comma at the end.

    Try this, (not tested)

    Code (SQL):
    CREATE TABLE CFJH99ATM1STUSETEMP
    (
      CUST_ID         VARCHAR2(20) NOT NULL,
      CUST_NAME    VARCHAR2(29) NOT NULL,
      CARD_NO        VARCHAR2(16) NOT NULL,
      ACCT_NO        VARCHAR2(15) NOT NULL,
      TRANDT          VARCHAR2(11) NOT NULL,
      TRANTM         VARCHAR2(8) NOT NULL,
      TRAN_PLACE   VARCHAR2(40) NOT NULL,
      TRAN_TYPE     VARCHAR2(7) NOT NULL,
      PAYAMT          NUMBER(18,2) NOT NULL
    );
     
     CREATE UNIQUE INDEX CFJH99ATM1STUSETEMP_PK ON CFJH99ATM1STUSETEMP
     (CUST_ID);