Alpha Video Training
Results 1 to 7 of 7

Thread: Contrasting Append and Lookup

  1. #1
    Member
    Real Name
    Donald Raymond
    Join Date
    Jul 2000
    Location
    Long Island, NY
    Posts
    153

    Default Contrasting Append and Lookup

    I think it is safe to say that the append operation and database lookup function both are ways to move record info from one table to another. It seems to me that the using a lookup is always a smooth and quick operation, whereas, I have had trouble reliably using the append operation and it can be slow even appending one record (compared to data that is moved with a lookup). The append operation appears to slow in a multi-user enviroment as it has to lock and ulock the table.

    Are these two operations as similar as I think? Does Alpha "mechanically" treat them the same?

    I have a mission critical application that we haved used in our business for 5 years that uses append operations to move data from a sales order table to a workorder table (with additional fields added, like date, etc.). It has always operated slowly.

    Any thoughts?

    Thanks,

    Don

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Contrasting Append and Lookup

    An append operation adds records to a table based on some design. I fail to see how a lookup does anything similar. Could you elaborate?

  3. #3
    Member
    Real Name
    Donald Raymond
    Join Date
    Jul 2000
    Location
    Long Island, NY
    Posts
    153

    Default Re: Contrasting Append and Lookup

    Stan,

    I was thinking that when a lookup is performed, we select data from one table (the lookup source) and then once selected, it is "appended" or copied into the table we are filling in.

    In an append operation, we are copying records or select data from one table based on some criteria, into another table.

    Seems like the operations of each are similar.

    I realize that these are different operations used for different purposes, but it seems like they function similarly. Again, I am curious because true append operations seem to be slow due to table locking and unlocking, while lookup seems to be a similar process that moves quickly.

    I apologize if I am not making sense.

    Thanks,

    Don

  4. #4
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Contrasting Append and Lookup

    Making sense but I don't see them as equal. The append operation, especially a unique records only, has to evaluate the records in the master table, evaluate the records in the transaction table, decide if the first record in the transaction table is unique, append it, add it to the list of master table records against which to check the next transaction record, and in a multi-user situation, possibly reevaluate the records in the master table if a new record has been added or changed, then repeat.

    A lookup is only working on one record, one field, and changing its value.

    Unless I misunderstand your meaning, which is not at all unusual.

  5. #5
    Member
    Real Name
    Donald Raymond
    Join Date
    Jul 2000
    Location
    Long Island, NY
    Posts
    153

    Default Re: Contrasting Append and Lookup

    Stan,

    I see I am over simplifying the append operation, as the end result of data moving from one place to another is the only thing that is similar between the append and the lookup.

    I am using append operations to move 1 record at a time from a sales order form to a workorder form while adding additional information. When the Production Manager wishes to prepare a work order for the day, he appends data from the sales order, while automatically adding aditional data such as made date, pcs produced, etc. Works well, but the append can be slow.

    Thinking that if I understood the "mechanics" of how the lookup moved data, I could apply to my situation and not use the append operation.

    Don

  6. #6
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Contrasting Append and Lookup

    No problem. Should be easy to help you construct a small script which would

    read the values from the sales order form
    open the work order table
    create a new record there
    populate the new record with the values from the sales order
    populate the new record with aditional data such as made date, pcs produced

    This script should execute "instantaneously".

    An alternative might be to delve into marking records. If all records in the sales order table are initially unmarked, you mark the record while in the sales order form, change the append operation to operate on marked records, it should process exceedingly quickly.

    How many people are using the feature of transferring records from sales order to work order?

  7. #7
    Member
    Real Name
    Donald Raymond
    Join Date
    Jul 2000
    Location
    Long Island, NY
    Posts
    153

    Default Re: Contrasting Append and Lookup

    Stan,

    Thanks for your response. The script that you detail is exactly the process that I am using. I have tried the marking technique you suggest, but found that if for any reason the record is not unmarked, obviously there was trouble. I still mark and unmark the record so there is a visual action on the screen when a record is selected to be appended, but the actual append operation is based on a unique serial number.

    Each record in the Sales Order table has a unique serial number. There is a button on the sales order screen that grabs the serial number of the current record, and then the following script is run:

    :Pick_off_Production_Ord:BROWSE1.activate()
    :Pick_off_Production_Ord:Tables:PRODUCTION_ORDER_DETAIL.change_begin(HONOR_FIELD_RULES)
    :Pick_off_Production_Ord:Tables:PRODUCTION_ORDER_DETAIL.mark()
    :Pick_off_Production_Ord:Tables:PRODUCTION_ORDER_DETAIL.change_end(.t.)
    :Append.run_silent("Append Workorder")
    :Pick_off_Production_Ord:Tables:PRODUCTION_ORDER_DETAIL.change_begin(HONOR_FIELD_RULES)
    :Pick_off_Production_Ord:Tables:PRODUCTION_ORDER_DETAIL.unmark()
    :Pick_off_Production_Ord:Tables:PRODUCTION_ORDER_DETAIL.change_end(.t.)


    The append operation then finds the matching record (by serial number) in the sales order table and then appends the information to the workorder table.

    Please note that the sales order and workorder sets are about 10 tables deep.

    Don

Similar Threads

  1. Can I use append?
    By richardb in forum Alpha Five Version 5
    Replies: 8
    Last Post: 07-11-2005, 08:31 AM
  2. Can't Append
    By Amateur in forum Alpha Five Version 5
    Replies: 18
    Last Post: 09-04-2004, 10:14 AM
  3. APPEND
    By oroma in forum Alpha Five Version 5
    Replies: 4
    Last Post: 08-26-2003, 07:21 PM
  4. append
    By Duane Pederson in forum Alpha Five Version 4
    Replies: 4
    Last Post: 04-07-2001, 07:38 AM
  5. Append Help
    By Daniel Weiss in forum Alpha Five Version 4
    Replies: 13
    Last Post: 05-09-2000, 10:25 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •