Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update w/ Multiple tbls

Status
Not open for further replies.

Bigced21

Programmer
Feb 5, 2003
76
US
- The tbl i want to update is Blr_insp which has 100 recs, and the col in that tbl to be updated is insp_id.
- The tbl Insp has 5 inspector names along w/ there badge_no
- The tbl Blr has 100 recs in it the has a col named state_no that I can use as a reference to query the correct data.
- The tbl zImport contains the original data such badge_no which I can match up w/ tbl Insp badge_no & state_no which is which can match up w/ tbl Blr.

What i want to do is update the Insp_ID of Blr_Insp with correct Inspectors that did the inspection on the Boiler's.
 
Here's a schema of the four tables

- Blr_insp - ID, Inspector_ID, Boiler_ID, Fee_Amount, Paid_Flag

- Insp - ID, Badge_No, Inspector_EmployerDef_ID, Contact_ID

- Blr - ID, State_No, Year_Built, Nat_Brd_No, County_ID, Manufacturer_ID, Loc_Plant, TypeDef_ID, Nat_BusinessDef_ID, Year_TypeDef_ID, UseDef_ID, FuelDef_ID, Inspect_TypeDef_ID

- zImport - ID, State_No, Nat_Brd_No, Insurance_No, Inspection_Date, Expire_Date, Year_Type, Status, State_Owned
 
How are these tables joined ?
Please, show us the relations between the tables.
Knowing the Primary Keys and Foreign Keys may also help.
 
Ah the relationships between the tables.

What is the name of the column in zImport that has the badge numbers, that we want to match up to Badge_No?

Is there only one boiler per state_no?

If not, you will need more than the state_no to match rows in zImport to rows in Blr. Or maybe there is only one inspector per state_no?

Finally, what brand of database are you using?
 
I've figured it out already from some examples I found. Thanks for your help though!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top