home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / database / 8637 < prev    next >
Encoding:
Internet Message Format  |  1992-12-22  |  1.7 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!wupost!waikato.ac.nz!comp.vuw.ac.nz!ferrari.datamark.co.nz!david
  2. Newsgroups: comp.databases
  3. Subject: Re: FoxPro problem with outer join
  4. Message-ID: <1992Dec21.205208.39096@datamark.co.nz>
  5. From: david@datamark.co.nz (David Rowland)
  6. Date: Mon, 21 Dec 1992 20:52:08 GMT
  7. References: <1992Dec21.012636.28374@gopher.dosli.govt.nz>
  8. Organization: Datamark International Ltd.
  9. Lines: 42
  10.  
  11. In article <1992Dec21.012636.28374@gopher.dosli.govt.nz> srlncnc@gopher.dosli.govt.nz (Chris Crook) writes:
  12. >
  13. >Can anyone offer any advice on how to solve the following problem in FoxPro
  14. >(other than by using Paradox!).
  15. >
  16. >I have a one table (table1) with the following fields
  17. >
  18. >    unique_key
  19. >    field1
  20. >    field2
  21. >
  22. >and a second table (table2) with the fields
  23. >
  24. >    unique_key
  25. >    field2
  26. >
  27. >The key is common to the two tables, but table2 has only a subset of the
  28. >key values that are present in table1.  I would like to do is replace the
  29. >field2 values in table1 for which there is a corresponding key in table2,
  30. >leaving the rest of table1 untouched.
  31. >
  32.  
  33. SELECT 0
  34. USE table2 ORDER unique_key
  35.  
  36. SELECT 0
  37. USE table1 ORDER unique_key
  38. SET RELATION TO unique_key INTO table2
  39. GO TOP
  40.  
  41. SCAN FOR table1.unique_key = table2.unique_key
  42.      REPLACE table1.field1 WITH table2.field1
  43. ENDSCAN
  44.  
  45. Dave
  46. --
  47. +---------------------+--------------------------------------------------+
  48. | David Rowland       | The British are using New Zealanders.  They must |
  49. | Datamark Intl Ltd   | really mean business !                           |
  50. | Wellington          |      -  General Rommel During Northern African   |
  51. | NEW ZEALAND         |         Campaign WWII.                           |
  52. +---------------------+--------------------------------------------------+
  53.