Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
  #1  
Old March 16th, 2004, 07:39 AM
peaceful_girl peaceful_girl is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 39 peaceful_girl User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 21 m 21 sec
Reputation Power: 0
foreign key problem

if someone can help me in this now
I have an error , i want to make a foreign key but it is not working

SQL> create table violation (violation_no number(5) constraint violation_no primary key,
2 violation_type varchar2(20), place_of_violation varchar2(10),
3 date_of_violation date, violation_status varchar2(10), license_no number(7) constraint license_
no foreign key, vehicle_no number(15) constraint vehicle_no foreign key, money_to_pay number(5));
date_of_violation date, violation_status varchar2(10), license_no number(7) constraint license_no fo
*
ERROR at line 3:
ORA-02253: constraint specification not allowed here

Last edited by peaceful_girl : March 16th, 2004 at 07:41 AM.

Reply With Quote
  #2  
Old March 31st, 2004, 01:25 PM
jimbag8 jimbag8 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 28 jimbag8 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
You need to specify what each column references table(column)

I would recommend taking out all of the FK pieces in your table create syntax and go back in and manually adding them.

ALTER TABLE table name ADD CONSTRAINT FK_constraint_name foreign key(column_name)
references other table(column_name);

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > foreign key problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway