home *** CD-ROM | disk | FTP | other *** search
- ; Contains Licensed Material Copyright (C) 1987 Ansa Software -- MJP
-
- ; This script demonstrates one way to post the multi-line order information
- ; from the entry table (TKEntry) into the table which maintains all order
- ; information (Orders). The script assumes that a maintained secondary index
- ; exists for the Orders table on the Part field. (This will aid in the deletion
- ; of duplicate records that are created as a by-product of the process.)
- ;
- ; Note that this procedure will not post all of the information on the form, as
- ; it is only a demonstration of how to post one-to-many. The posting of records
- ; into other tables where there is a one-to-one relationship can be done very
- ; simply using MultiEntry or MultiAdd.
- ;
- Query
-
- Tkentry | Invoice Number | Quan1 | Part1 | Quan2 |
- | _Inv | _Quan1 | _Part1 | _Quan2 |
- | | | | |
-
- Tkentry | Part2 | Quan3 | Part3 | Quan4 | Part4 | Quan5 |
- | _Part2 | _Quan3 | _Part3 | _Quan4 | _Part4 | _Quan5 |
- | | | | | | |
-
- Tkentry | Part5 | Quan6 | Part6 | Quan7 | Part7 | Quan8 |
- | _Part5 | _Quan6 | _Part6 | _Quan7 | _Part7 | _Quan8 |
- | | | | | | |
-
- Tkentry | Part8 |
- | _Part8 |
- | |
-
- Orders | Invoice Number | Line | Part | Quan |
- Insert | _Inv | 1 | _Part1 | _Quan1 |
- Insert | _Inv | 2 | _Part2 | _Quan2 |
- Insert | _Inv | 3 | _Part3 | _Quan3 |
- Insert | _Inv | 4 | _Part4 | _Quan4 |
- Insert | _Inv | 5 | _Part5 | _Quan5 |
- Insert | _Inv | 6 | _Part6 | _Quan6 |
- Insert | _Inv | 7 | _Part7 | _Quan7 |
- Insert | _Inv | 8 | _Part8 | _Quan8 |
-
- Endquery
-
- Do_It! ;The above query will cause the order information in each record of the
- ; TKEntry table to become eight records in the Orders table. The only
- ; problem is that blank orders will be inserted into the Orders table
- ; as well. To remedy this problem, we perform the following:
- Query
-
- Orders | Part |
- Delete | Blank |
-
- Endquery
-
- Do_It! ;This query will remove all blank entries