Seems to me that the proper solution is to create a new record, and use
a status indicator to determine where the cargo is currently.

Updating the FK causes you to lose any history of where the cargo has been.

ie. no cargo tracking possible.

This is my off the cuff, didn't spend a great deal of time on it, hope it works
for you, answer.  

As you said though, the current process is highly suspect.

Jared




<[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]

 11/06/2003 06:44 AM
 Please respond to ORACLE-L

       
        To:        Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]>
        cc:        
        Subject:        datamodelling question: updating foreign keys



I remember seeing this question asked on another forum some time back. I dont like the solution the guy had and Im wondering how some of you might solve problem. Im giving a low level generic example.

Lets say you have a parent-child relationship. The parent table is 'TRUCKS' and the child table is 'CARGO'. The foreign key to CARGO tells which truck the cargo is loaded on. When the cargo is moved to another truck, the foreign key is updated.

I dont like this approach. it causes contention. what is a better way to design this?

--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: <[EMAIL PROTECTED]
 INET: [EMAIL PROTECTED]

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).


Reply via email to