Home » SQL & PL/SQL » SQL & PL/SQL » Remove Primary key in this situation?
Remove Primary key in this situation? [message #11238] Mon, 15 March 2004 05:59 Go to next message
pink
Messages: 23
Registered: July 2003
Junior Member
I have a table named wlbmach where I am storing the hardware machine information:

wlbmach_host_id (PK)
wlbmach_host_name
wlbmach_ip
wlbmach_operating_system
wlbmach_change_ind
wlbmach_activity_date

Now I want to add comments for the machine and maintain a seperate table for it so I can have many comments per machine:

wlbhcmt_host_id(FK)
wlbmach_config_desc

My problem is .. If I change the operating system of the machine then I have to use the same host_id since the machine is the same.. and I make the wlbmach_change_ind = "I" (Invalid) and add a new record...

I cannot do this because its the PK so I cannot have same host id again? and if I dont make it PK then can the comments table wlbhcmt_host_id refer to it...?

I will just have to remove the relations of PK and FK right?

 
Re: Remove Primary key in this situation? [message #11243 is a reply to message #11238] Mon, 15 March 2004 13:55 Go to previous message
William Robertson
Messages: 1643
Registered: August 2003
Location: London, UK
Senior Member
What's wrong with:
UPDATE wlbmach
SET    wlbmach_operating_system = 'Mac OSX'
WHERE  wlbmach_host_id = 1;
Previous Topic: sql question
Next Topic: Oracle Boot Camp
Goto Forum:
  


Current Time: Thu Apr 18 18:30:01 CDT 2024