Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2011
    Posts
    3

    Unanswered: ORA-00904: : invalid identifier

    Hello,
    I was hoping someone could please please help me! I am very new to DB.
    I am trying to pass my DDL to create the below table however I am getting an ORA-00904 error, I have checked all the column names but cannot find where/what the issue is...Help would be greatly appreciated!.
    I am running oracle 10g express

    Create table BILLING (
    BL_CODE Number (8) PRIMARY KEY,
    BL_STATUS Varchar2 (10) NOT NULL,
    BL_CONTACTDATE Date,
    BL_CLOSEDATE Date,
    BL_TOTAL Decimal (7,2) NOT NULL,
    BL_AMOUNTPAID Decimal (7,2),
    BL_OUTSTANDING Decimal (7,2),
    BL_STARTDATE Date,
    );

  2. #2
    Join Date
    Apr 2008
    Location
    Iasi, Romania
    Posts
    561
    Provided Answers: 2
    It's the last comma.

    ...
    BL_STARTDATE Date
    );
    Florin Aparaschivei
    DB2 9.7, 10.5 on Windows
    Iasi, Romania

  3. #3
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Two errors:
    - BL_STARTDATE Date, - a superfluous comma
    - Dynamic SQL shouldn't end with a semi-colon (your last line).

    Standard procedure (when dealing with dynamic SQL) is to display the statement on the screen (DBMS_OUTPUT would do). If copy/paste of the same statement works OK in SQL*Plus, it'll most probably be OK in PL/SQL.

    Code:
    SQL> declare
      2    l_str varchar2(1000);
      3  begin
      4  l_str := '
      5  Create table BILLING (
      6   BL_CODE Number (8) PRIMARY KEY,
      7   BL_STATUS Varchar2 (10) NOT NULL,
      8   BL_CONTACTDATE Date,
      9   BL_CLOSEDATE Date,
     10   BL_TOTAL Decimal (7,2) NOT NULL,
     11   BL_AMOUNTPAID Decimal (7,2),
     12   BL_OUTSTANDING Decimal (7,2),
     13   BL_STARTDATE Date
     14   )';
     15   execute immediate l_str;
     16  end;
     17  /
    
    PL/SQL procedure successfully completed.
    
    SQL> desc billing;
     Name                                                  Null?    Type
     ----------------------------------------------------- -------- ----------------
     BL_CODE                                               NOT NULL NUMBER(8)
     BL_STATUS                                             NOT NULL VARCHAR2(10)
     BL_CONTACTDATE                                                 DATE
     BL_CLOSEDATE                                                   DATE
     BL_TOTAL                                              NOT NULL NUMBER(7,2)
     BL_AMOUNTPAID                                                  NUMBER(7,2)
     BL_OUTSTANDING                                                 NUMBER(7,2)
     BL_STARTDATE                                                   DATE
    
    SQL>
    P.S. On a second thought, is it PL/SQL you are dealing with? This statement ("I am trying to pass my DDL ...") made me think so.

Tags for this Thread

Posting Permissions

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