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

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

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:
  #1  
Old December 1st, 2003, 06:55 AM
LJ... LJ... is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 4 LJ... User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Creating a Composite Key.....

CREATE TABLE addresses OF address
(
houseNum PRIMARY KEY
);


This is how I create a primary key when creating a table.

Does anyone know how I would create a primary key using both the house number and say the telephone number (ie. telNo), which in effect would be a composite key????

Reply With Quote
  #2  
Old December 1st, 2003, 08:16 AM
Dan Drillich Dan Drillich is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 68 Dan Drillich User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 10
create table addresses (

houseNum NUMBER,
telNo NUMBER,

constraint pk_address primary key (houseNum,telNo)

)

Regards,
Dan

Reply With Quote
  #3  
Old December 1st, 2003, 09:30 AM
LJ... LJ... is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 4 LJ... User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
That gives me this error:-


SP2-0734: unknown command beginning "constraint..." - rest of line ignored.
SP2-0042: unknown command ")" - rest of line ignored.



Its like as if it doesnt recogise the word "constraint" ???????

Reply With Quote
  #4  
Old December 1st, 2003, 09:49 AM
LJ... LJ... is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 4 LJ... User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Its okay, I got it!

Thanks, you were right, with a little adjustment of the syntax.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > Creating a Composite Key.....

Developer Shed Advertisers and Affiliates



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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap