home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!wupost!waikato.ac.nz!comp.vuw.ac.nz!ferrari.datamark.co.nz!david
- Newsgroups: comp.databases
- Subject: Re: FoxPro problem with outer join
- Message-ID: <1992Dec21.205208.39096@datamark.co.nz>
- From: david@datamark.co.nz (David Rowland)
- Date: Mon, 21 Dec 1992 20:52:08 GMT
- References: <1992Dec21.012636.28374@gopher.dosli.govt.nz>
- Organization: Datamark International Ltd.
- Lines: 42
-
- In article <1992Dec21.012636.28374@gopher.dosli.govt.nz> srlncnc@gopher.dosli.govt.nz (Chris Crook) writes:
- >
- >Can anyone offer any advice on how to solve the following problem in FoxPro
- >(other than by using Paradox!).
- >
- >I have a one table (table1) with the following fields
- >
- > unique_key
- > field1
- > field2
- >
- >and a second table (table2) with the fields
- >
- > unique_key
- > field2
- >
- >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
-
- Dave
- --
- +---------------------+--------------------------------------------------+
- | David Rowland | The British are using New Zealanders. They must |
- | Datamark Intl Ltd | really mean business ! |
- | Wellington | - General Rommel During Northern African |
- | NEW ZEALAND | Campaign WWII. |
- +---------------------+--------------------------------------------------+
-