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-02264: name already used by an existing constraint

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: Feb 2013
Posts: 11
ORA-02264: name already used by an existing constraint

Sorry for ANOTHER thread but here's the thing I am trying to achieve.

Here is the tables I am trying to connect in diagram view:

http://i46.tinypic.com/a6r.jpg

I am trying to link the Part-no but it keeps giving the error mentioned in the title


The batch table:
Code:
CREATE TABLE  "BATCH" 
   (	"BATCH-NO" NUMBER(10,0), 
	"PART-NO" NUMBER(10,0) NOT NULL ENABLE, 
	"FACTORY-NO" NUMBER(5,0) NOT NULL ENABLE, 
	"CONTAINER-NO" NUMBER(5,0) NOT NULL ENABLE, 
	 CONSTRAINT "BATCH_CON" PRIMARY KEY ("BATCH-NO") ENABLE
   )
/

CREATE OR REPLACE TRIGGER  "BI_BATCH" 
  before insert on "BATCH"               
  for each row  
begin   
  if :NEW."BATCH-NO" is null then 
    select "BATCH_SEQ".nextval into :NEW."BATCH-NO" from dual; 
  end if; 
end; 

/
ALTER TRIGGER  "BI_BATCH" ENABLE
/
Code:
CREATE TABLE  "PART" 
   (	"PART-NO" NUMBER(9,0) NOT NULL ENABLE, 
	"NAME" VARCHAR2(50 CHAR), 
	"MANUFACTURING-ROUTE-NUMBER" NUMBER(9,0), 
	"DRAWING-ADDRESS" VARCHAR2(50 CHAR), 
	 CONSTRAINT "PART_PK" PRIMARY KEY ("PART-NO") ENABLE
   )
/
ALTER TABLE  "PART" ADD CONSTRAINT "PART_CON" FOREIGN KEY ("MANUFACTURING-ROUTE-NUMBER")
	  REFERENCES  "MANUFACTURING-ROUTE" ("M-ROUTE-NO") ENABLE
/

CREATE OR REPLACE TRIGGER  "BI_PART" 
  before insert on "PART"               
  for each row  
begin   
  if :NEW."PART-NUMBER" is null then 
    select "PART_SEQ".nextval into :NEW."PART-NUMBER" from dual; 
  end if; 
end; 

/
ALTER TRIGGER  "BI_PART" ENABLE
/
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
Join Date: Aug 2003
Location: Where the Surf Meets the Turf @Del Mar, CA
Posts: 7,495
02264, 00000, "name already used by an existing constraint"
// *Cause: The specified constraint name has to be unique.
// *Action: Specify a unique constraint name for the constraint.
__________________
You can lead some folks to knowledge, but you can not make them think.
The average person thinks he's above average!
For most folks, they don't know, what they don't know.
Don't say, show. Don't promise, prove.
Reply With Quote
Reply

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