Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

APPEND and UPDATE. Get's a bit complicated ... at least to me.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    APPEND and UPDATE. Get's a bit complicated ... at least to me.

    I want to perform an operation(s) that will add or update a record in a table.

    Here's the case. I have the health data of a breed of dogs for the past 17 years. It is in the form of quarterly tables so ... 68 tables. Some of the data represents a single result such as a hip x-ray which is graded and the grade is good for the life of the dog. Several other tests are the same. However, one test must be repeated every 15 months.

    I thought I could take the oldest file and declare it to be the "Master file". Then I would take each successive quarterly table and use it as a "transaction table" to POST the Master table. However, the POST command doesn't seem to have the ability to "replace" a record in the Master table with a record from the Transaction table.

    So, I've now hit on the idea of pre-processing the transaction table to split the table into two tables, one that contains records that will be APPENDed to the Master table and one that will UPDATE records. Then run the APPEND table against the Master table and the UPDATE table against the Master table, Then toss those 2 tables and pre-process the next quarterly table and use these to APPEND/UPDATE the Master.

    However, this brings up one case. What can be done about the first instance of an eye exam, the exam that must be done at least every 15 months? The eye exam would normally be handled by the UPDATE process but the first time there's nothing to UPDATE. Do I need to run the UPDATE process first and trap those transaction table records that won't UPDATE to submit to the APPEND process?

    Also, can all these by written as one process or do they need to be separate processes.

    #2
    Re: APPEND and UPDATE. Get's a bit complicated ... at least to me.

    The append operation has an option for unique only meaning it appends only records with unique linking field values. That takes care of first visit records. All your processes need to be separate although you can trigger them all with one button.
    There can be only one.

    Comment


      #3
      Re: APPEND and UPDATE. Get's a bit complicated ... at least to me.

      Thanks Stan. I'm going to keep this as a Plan B. I've just realized that I can generate a search of the other site/database from a dog's record in my database and get the info >presto<. The rreal advantage is that we'll always be current rather than waiting until the next quarter. However, thanks again, I'll use it someday.

      Eric

      Comment


        #4
        Re: APPEND and UPDATE. Get's a bit complicated ... at least to me.

        in operations, you have append that adds records to a table from another table.
        You also have a post which will post records to a table from another table. You can choose which records you wish to post to and from. It is a lot faster than update in most cases and depending the use. I just did that where I had done it with update and used lookup() to get the values from another table that took 3.5 hours and using the post method took that to about 12 minutes. Numbers of records was over 100 k and 38 fields involved(some empty).
        Dave Mason
        [email protected]
        Skype is dave.mason46

        Comment


          #5
          Re: APPEND and UPDATE. Get's a bit complicated ... at least to me.

          Originally posted by DaveM View Post
          I just did that where I had done it with update and used lookup() to get the values from another table that took 3.5 hours and using the post method took that to about 12 minutes. Numbers of records was over 100 k and 38 fields involved(some empty).
          Dave

          Your example of the update and lookup() that took 3.5 hours needs to get broken down to what caused the long execution.

          The update was fast, the lookup() was what slowed it.

          Using a set defined to make the update would make it much faster.

          Each tool has it's place and lookups with an operation is a mixture for performance issues.

          As Stan noted, Eric's situation is best served by the append - add unique, update existing model.
          Al Buchholz
          Bookwood Systems, LTD
          Weekly QReportBuilder Webinars Thursday 1 pm CST

          Occam's Razor - KISS
          Normalize till it hurts - De-normalize till it works.
          Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
          When we triage a problem it is much easier to read sample systems than to read a mind.
          "Make it as simple as possible, but not simpler."
          Albert Einstein

          http://www.iadn.com/images/media/iadn_member.png

          Comment


            #6
            Re: APPEND and UPDATE. Get's a bit complicated ... at least to me.

            Al,

            My situation was 37 empty fileds after an append. The other 37 needed to be filled from a 3rd table. This would have been simple if for my own use, but will be done 1500 miles from here on different computers.
            I can't create a set on the companies old db for this purpose, so I have a partially filled table and another table with the records that need to go into it.

            involves 3 tables tablea is final product. Tablec is the one contains the other field data I need. sever has original tables I need records from

            append old data from server:
            append to tablea from same on server
            append tablec from same on server
            post data to table a from tablec to tablea
            Table a now has all "complete" records.

            The original tablea on server only has, say, 30 fields.
            The original tablec on server only has, say, 42 fields.


            My tablea has about 70 fields when done
            I first get the 30 from server to tablea and 42 from server to tablec, Then post 37 from tablec to tablea

            I am done.

            Appending(not unique) 65+ tables, doing some mods, updating a few and posting takes 41.00(approx.) minutes which is livable. 4 hours was a stretch.

            The new and revised tables go to the new server completely empty and the reason for all the appends and work.
            Client is ok to 1.5 hours for this.

            I am actually combining two tables into one, but found the operations to do that(like join) were not solid enough. May have been me. This has to be exact when done.

            The code for the post looks something like this:
            Code:
            
            a_tbl = table.open("tops")
            
            post.t_db = "prop"
            post.m_key = "File_Num"
            post.t_key = "File_Num"
            post.m_filter = ""
            post.t_filter = ""
            post.m_count = 37
            post.m_field1 = "Address"
            post.m_exp1 = "@PROPERTY->Address"
            post.m_field2 = "Address2"
            post.m_exp2 = "@PROPERTY->Address2"
            post.m_field3 = "First_Name"
            post.m_exp3 = "@PROPERTY->First_Name"
            post.m_field4 = "Last_Name"
            post.m_exp4 = "@PROPERTY->Last_Name"
            post.m_field5 = "City"
            post.m_exp5 = "@PROPERTY->City"
            post.m_field6 = "Zip"
            post.m_exp6 = "@PROPERTY->Zip"
            post.m_field7 = "Province"
            Last edited by DaveM; 11-27-2014, 03:22 PM.
            Dave Mason
            [email protected]
            Skype is dave.mason46

            Comment

            Working...
            X