RE: datamodelling question: updating foreign keys

2003-11-06 Thread Kevin Toepke
Yes. There is a better way to model that. Oh, you wanted a suggestion. How about including a LOADS table that has (at least) 3 colums truck_id cargo_id active_flag That way when cargo is moved to a different truck you add a new record to the LOADS table and update the

RE: datamodelling question: updating foreign keys

2003-11-06 Thread Whittle Jerome Contr NCI
Title: RE: datamodelling question: updating foreign keys Ryan, You'll probably like my solution less, but it worked for me. You don't have a parent-child relationship as a Truck can have more than one Cargo and Cargo can be loaded on more than one Truck. Rather you have a many to many

Re: datamodelling question: updating foreign keys

2003-11-06 Thread Todd Boss
I don't know if this is a better model at all. In fact, all this accomplishes is leaving behind tons of useless records. I'd only recommend this model if (for any reason) the trail of the truck history for this cargo. This way of marking records also leaves you open for the obvious future

Re: datamodelling question: updating foreign keys

2003-11-06 Thread AK
Well , How about cargo as table with primary key say cargo_id which unqiely identifies cargo and weight . Now you should have a cargo detail table that will have cargo_id , load , truck_id . So Cargo - cargo_id total_load date blah blah cargo_detail - cargo_id

Re: datamodelling question: updating foreign keys

2003-11-06 Thread Thomas Day
Have a table SHIPMENTS. When a CARGO moves to another TRUCK it becomes a new SHIPMENT. SHIPMENTS has foreign keys to TRUCKS and CARGOES.

Re: Re: datamodelling question: updating foreign keys

2003-11-06 Thread ryan_oracle
recipients of list ORACLE-L [EMAIL PROTECTED] Subject: Re: datamodelling question: updating foreign keys Well , How about cargo as table with primary key say cargo_id which unqiely identifies cargo and weight . Now you should have a cargo detail table that will have cargo_id , load

Re: datamodelling question: updating foreign keys

2003-11-06 Thread Jared . Still
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

RE: datamodelling question: updating foreign keys

2003-11-06 Thread Jared . Still
Please respond to ORACLE-L To:Multiple recipients of list ORACLE-L [EMAIL PROTECTED] cc: Subject:RE: datamodelling question: updating foreign keys Ryan, You'll probably like my solution less, but it worked for me. You don't have a parent-child relationship as a Truck