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

move records to storage table

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

    move records to storage table

    I have one form that collects data for two tables (linked by customer_no). These tables get really large and slow the whole system down and so I want to move the data into a storage table(s) based on the date that the data was entered.This is an operation that will need to be carried out from time to time and I do not want to over write any existing storage data when I carry out future operations.

    For the records that were created in the table FLIGHTS I have created a form that allows the user to input a variable to select a date to compare against two posible dates that may exist in each record(VAR-"Start_Date). I then have a button that when activated opens another form with a browse in to display the resulting records. The button on the first form is set onPush to carry out the following:

    if((Flights-"Depart_date "= Var-"Start_Date
    .AND.
    Flights-"Return_date={})
    .or.
    (Flights-"Depart_date "= Var-"Start_Date .AND.Flights-"Return_date "= Var-"Start_Date),.T.,.F.)

    this filters the records that I want and seems to work just fine.

    Next using "Select Action from Form Menu" I have set a button on this form(MOVE RECORDS) onPush to carry out two actions: 1)select all, and 2) move the records... I am then able to select the table to move it to. In theory it should move the records to the target table that I select and delete the originals from the original table

    However, I am getting an error message:SCRIPT UI_MODELESS_DLG_BOX::storage_selection@:Move Records line :86 generate_xbasic(vl) sfn not found. I have no idea what it is telling me!

    I am hoping that someone can tell me in simple layman's terms what I need to do to be able to move records from two tables as may be required from time to time into either one or two storage tables that can be accessible in future... Because I am initially using two tables to collect the data in(these tables would be equivalent in nature to customer and products) I imagine that I would need to put them into two corresponding "storage" tables or can I use the customer_no to create one storage table to put all the data into?

    Keeping my fingers crossed,

    Angie



    #2
    RE: move records to storage table

    "These tables get really large...."

    How big is that? Are you networked? Optimized?

    I ask because properly indexed tables have to be really big before they slow down functioning.

    Bill
    Bill Hanigsberg

    Comment


      #3
      RE: move records to storage table

      Yes, we are networked. We are near 40,000 records and adding new records at about 2000+ per month (it is a database to handle passenger / flight records for a small but quickly growing airline... I have manually moved records into a storage file but want to build a method for the boss to do it on her own...

      Angie

      Comment


        #4
        RE: move records to storage table

        Hi Angie,

        ...and you are using network optimization?

        That is not such a big table which leads me to wonder about your indexing. But the only way to review that is to see the whole application or a demo with a subset of records.

        I apologize for evading your actual question. One way to approach that is with a series of operations. First create an exact duplicate of the table in question and then:

        1. unmark all marked records in the source table (just in case);
        2. mark records in the source table prior to a specific date;
        3. copy marked records in the source table to the destination table;
        4. delete marked records in the source table.

        I think the genies should define each of these operations without difficulty.

        Then create a script to run the operations in sequence.

        You will need to insert this inline xbasic in the script between the operations so that the previous is finished before the next begins:
        xbasic_wait_for_idle()

        You can run this script from the control panel or from a button on a form.

        Caution: don't do this with a bunch of users on the system. Best to kick everyone but the boss off before this is run.

        This is not hard. I throw together a demo for you if you need it.

        Bill
        Bill Hanigsberg

        Comment


          #5
          RE: move records to storage table

          William,
          Just a little off topic response to your much appreciated comments and query about network optimization...

          Each of our users (agents) run a local copy of the application, but share a central database on the server.
          They each do this by starting Alpha Five (Runtime) and then choosing the database to run from the server. I have just recently read up on shadow databases and am a bit more informed but as I do not know very much about
          shadow databases, I am concerned that relying on the agents' manual refreshing, which would have to take place prior to each ticket being written, leaves room for error in that too many tickets could be written for the same flight if just one agent did not remember to refresh the database. If I assign intervals at which it can be refreshed automatically, how frequent should these intervals be (every 20 seconds or does that frequency add to slowing the system down?)

          As for the offer to show me a demo/sample of what you are talking about, that would be wonderful... I will give your response a try but any help samples or demos to keep me on track is much appreciated...

          When you say create an "exact" duplicate of the table in question, are you meaning records as well or structure, rules etc...? Will I be able to add records to the new destination table in future or will the destination file be re-created each time we want to move files to it? We need to keep these records for a long period of time and so I do not want the destination table to be overwritten the next time the operation is run.

          Angie

          Comment


            #6
            RE: move records to storage table

            Actually, I am following your operations and all is going well, except how do you mark all the records at one time that meet the criteria... (those records that occur before the var-"start_date). I know how to mark them individually, but with thousands of records it could be a lengthy, cumbersome job? I have them filtered to a browse i fthat helps you ...

            By-the-by... I realized of course after my last response that I don't duplicate the records to the new "duplicated" destination database... silly question on my part...been a long day!

            Thanks again

            Angie

            Comment


              #7
              RE: move records to storage table

              Angie,

              If you have not properly optimized your your application for the network you should focus your initial efforts there.

              The refresh issue you raise is not germane; it arises from a misconception about what is being refreshed. The data is shared and does not have to be refreshed as there is a single copy of it--the server's. However, each optimized local station has its own copy of the application: screen definitions etc. Only if you should change these--update the application itself--would you need to refresh the local stations.

              Search this forum on the subject of network optimization. Consult the online help. This is what you need to do first regardless of whether you ultimately decide to slim down your data tables.

              Bill
              Bill Hanigsberg

              Comment


                #8
                RE: move records to storage table

                Angie,

                I neglected to respond to your question about how to mark a subset of records:
                1. operations tab
                2. choose new
                3. from the list choose mark records from the list on the left and select your table from the list on the right
                4. choose create using genie
                5. on the which records to mark screen choose "selected records"
                6. choose "marked/unmarked records" and check "marked"
                etc.

                Bill
                Bill Hanigsberg

                Comment


                  #9
                  RE: move records to storage table

                  Bill,

                  40,000 records is really no big thing. Most of our tables are over 100,000 records, and we don't have most users optimized yet because we are still in development. I think this might be more of an index issue and not a record qunatity issue.

                  Networking may also be an issue. How are the users connecting? Dial-up is intollerable. How quick s the server? More than CPU power, Disk access speed is very important.

                  Tom

                  Comment


                    #10
                    RE: move records to storage table

                    Hey Tom,

                    Look up. I suggested the same thing. I do not think it is table size either. Also, she appears not to have used network optimization.

                    So I am telling her how to implement the solution she envisions while also suggesting other solutions.

                    Bill
                    Bill Hanigsberg

                    Comment


                      #11
                      RE: move records to storage table

                      Thank you, the marking process is working fine now. I want you to know that I very much appreciate your comments and advice on optimizing and will do this on each computer asap... I have little experience with Alpha and have made my way through it only because no one else in the area knows anything about it and the "boss" has chosen to use it... I did seek (telephone) support and even sent a disk with the program on it much earlier in the game to find out what I could do to get the program to work more effeciently as the CPU usuage was extremely high and the program was running very inefficiently...but was told the problem was not with Alpha and not advised about optimizing or that it was even an option... so I learn as I go and it is thanks to you and people like you that I have made it thus far... Thank you!
                      Angie

                      Comment


                        #12
                        RE: move records to storage table

                        Angie,

                        Along with the other suggestions, you might want to look at "lightning query optimization" section in the manual.

                        For example, you created the following filter:
                        if((Flights-"Depart_date "= Var-"Start_Date
                        .AND.
                        Flights-"Return_date={})
                        .or.
                        (Flights-"Depart_date "= Var-"Start_Date .AND.Flights-"Return_date "= Var-"Start_Date),.T.,.F.)

                        However, since {} is less than any valid date, you could write a query filter as
                        "Flights-"depart_date"=var-"Start_date.and.Flights-"return_date"=var-"Start_date"

                        Some changes like this could speed up your app.

                        Pat
                        Pat Bremkamp
                        MindKicks Consulting

                        Comment


                          #13
                          RE: move records to storage table

                          Thank-you Pat, all suggestions are greatly appreciated.

                          Angie

                          Comment


                            #14
                            RE: move records to storage table

                            Angie,

                            It's probably unnecessary to add that before you do any of this marking and deleting stuff you should backup the whole application. Don't forget to verify the backup.

                            But let me reiterate the belief that if you properly index (Pat is on the mark here) and optimize your application your table size will cease to be an issue.

                            You can still slim down your working tables as desired but this is no substitute for having the application set up properly.

                            Bill
                            Bill Hanigsberg

                            Comment

                            Working...
                            X