If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > ORA-00904: : invalid identifier

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-08-11, 05:14
faustian_1 faustian_1 is offline
Registered User
 
Join Date: Nov 2011
Posts: 3
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,
);
Reply With Quote
  #2 (permalink)  
Old 12-08-11, 08:00
aflorin27 aflorin27 is offline
Registered User
 
Join Date: Apr 2008
Location: Iasi, Romania
Posts: 317
It's the last comma.

...
BL_STARTDATE Date
);
__________________
Florin Aparaschivei
Iasi, Romania
Reply With Quote
  #3 (permalink)  
Old 12-08-11, 08:09
Littlefoot Littlefoot is offline
Lost Boy
 
Join Date: Jan 2004
Location: Croatia, Europe
Posts: 3,629
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.
Reply With Quote
Reply

Tags
ddl, ora-00904, tables

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On