home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.databases
- Path: sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!bgsuvax!att!mcdchg!chinet!les
- From: les@chinet.chi.il.us (Leslie Mikesell)
- Subject: Re: FoxPro problem with outer join (Really UPDATE)
- Message-ID: <BzoDuE.FKE@chinet.chi.il.us>
- Organization: Chinet - Public Access UNIX
- References: <1992Dec21.012636.28374@gopher.dosli.govt.nz> <1992Dec21.205208.39096@datamark.co.nz>
- Date: Tue, 22 Dec 1992 19:23:01 GMT
- Lines: 25
-
- In article <1992Dec21.205208.39096@datamark.co.nz> david@datamark.co.nz (David Rowland) writes:
-
- >>The key is common to the two tables, but table2 has only a subset of the
- >>key values that are present in table1. I would like to do is replace the
- >>field2 values in table1 for which there is a corresponding key in table2,
- >>leaving the rest of table1 untouched.
- >>
- >
- >SELECT 0
- >USE table2 ORDER unique_key
- >
- >SELECT 0
- >USE table1 ORDER unique_key
- >SET RELATION TO unique_key INTO table2
- >GO TOP
- >
- >SCAN FOR table1.unique_key = table2.unique_key
- > REPLACE table1.field1 WITH table2.field1
- >ENDSCAN
-
- Instead of the indented section, why not just:
- UPDATE ON unique_key FROM table2 REPLACE field2 WITH table2.field2
-
- Les Mikesell
- les@chinet.chi.il.us
-