home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0020 - 0029 / ibm0020-0029 / ibm0028.tar / ibm0028 / PDXOS2-1.ZIP / SAMPLE / POST.SC < prev    next >
Encoding:
Text File  |  1988-12-29  |  2.3 KB  |  56 lines

  1. ; Contains Licensed Material Copyright (C) 1987 Ansa Software -- MJP
  2.  
  3. ; This script demonstrates one way to post the multi-line order information
  4. ; from the entry table (TKEntry) into the table which maintains all order
  5. ; information (Orders).  The script assumes that a maintained secondary index
  6. ; exists for the Orders table on the Part field.  (This will aid in the deletion
  7. ; of duplicate records that are created as a by-product of the process.)
  8. ;
  9. ; Note that this procedure will not post all of the information on the form, as
  10. ; it is only a demonstration of how to post one-to-many.  The posting of records
  11. ; into other tables where there is a one-to-one relationship can be done very
  12. ; simply using MultiEntry or MultiAdd.
  13. ;
  14. Query
  15.  
  16.  Tkentry | Invoice Number | Quan1  | Part1  | Quan2  |
  17.          | _Inv           | _Quan1 | _Part1 | _Quan2 |
  18.          |                |        |        |        |
  19.  
  20.  Tkentry | Part2  | Quan3  | Part3  | Quan4  | Part4  | Quan5  |
  21.          | _Part2 | _Quan3 | _Part3 | _Quan4 | _Part4 | _Quan5 |
  22.          |        |        |        |        |        |        |
  23.  
  24.  Tkentry | Part5  | Quan6  | Part6  | Quan7  | Part7  | Quan8  |
  25.          | _Part5 | _Quan6 | _Part6 | _Quan7 | _Part7 | _Quan8 |
  26.          |        |        |        |        |        |        |
  27.  
  28.  Tkentry | Part8  |
  29.          | _Part8 |
  30.          |        |
  31.  
  32.  Orders | Invoice Number | Line |  Part  |  Quan  |
  33.  Insert | _Inv           | 1    | _Part1 | _Quan1 |
  34.  Insert | _Inv           | 2    | _Part2 | _Quan2 |
  35.  Insert | _Inv           | 3    | _Part3 | _Quan3 |
  36.  Insert | _Inv           | 4    | _Part4 | _Quan4 |
  37.  Insert | _Inv           | 5    | _Part5 | _Quan5 |
  38.  Insert | _Inv           | 6    | _Part6 | _Quan6 |
  39.  Insert | _Inv           | 7    | _Part7 | _Quan7 |
  40.  Insert | _Inv           | 8    | _Part8 | _Quan8 |
  41.  
  42. Endquery
  43.  
  44. Do_It!  ;The above query will cause the order information in each record of the
  45.         ; TKEntry table to become eight records in the Orders table.  The only
  46.         ; problem is that blank orders will be inserted into the Orders table
  47.         ; as well.  To remedy this problem, we perform the following:
  48. Query
  49.  
  50.  Orders |  Part  |
  51.  Delete | Blank  |
  52.  
  53. Endquery
  54.  
  55. Do_It!  ;This query will remove all blank entries
  56.