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

Updating table takes 5 sec in a local PC setup.

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

  • Stan Mathews
    replied
    Re: Updating table takes 5 sec in a local PC setup.

    Originally posted by MoGrace View Post
    I did find a Record_Add() function in the Wiki but the page has weird chars on it so the syntax example wasn't much help.
    weird chars on it = HTML for Left Arrow with Hook

    Leave a comment:


  • MikeData
    replied
    Re: Updating table takes 5 sec in a local PC setup.

    Record_Add in the Alpha documentation there is method of use. It could use mode details.
    It probably has benefits too.

    Leave a comment:


  • pboomwork
    replied
    Re: Updating table takes 5 sec in a local PC setup.

    I have used the method MoGrace describes to append large numbers of records, over 100,000 and it is slightly faster. However when used for this number of appends the A5 enviroment became unstable started throwing wierd errors, stack space etc. that required a restart of Alpha5. The speed gain wasn't enought to warrent investigating the error messages further so I have no more details on the errors sorry.

    Leave a comment:


  • MoGrace
    replied
    Re: Updating table takes 5 sec in a local PC setup.

    It does the same as Stan's code it is just easier to use when you have the form's field values available.

    Edit: I tried to find the Wiki page for these methods with no luck (there is also a change_record() table method.
    In the legacy documentation if you have it, I found it under:

    What's New in V10 - Field Rules Now Honored During Xbasic Data Entry v10

    I did find a Record_Add() function in the Wiki but the page has weird chars on it so the syntax example wasn't much help.
    Last edited by MoGrace; 01-15-2017, 01:14 PM.

    Leave a comment:


  • MikeData
    replied
    Re: Updating table takes 5 sec in a local PC setup.

    I will try it. Thanks
    After this experience, I wonder how many other newer programmers out there, as I recall wondering how to make their network faster, as they complaint they had an slow network.
    Perhaps this was one of their issues; This would have help them.
    In my case in just one click, I was doing 2 tables record entry. Each one in the network using 12 to 15 seconds each. Now the 2 are a second or less.
    I have to try Robins code. As I am sure there will be use for that different code.
    Again thanks to all.

    Leave a comment:


  • MoGrace
    replied
    Re: Updating table takes 5 sec in a local PC setup.

    Here's another alternative using pointer dot variables:

    dim ra as p
    dim rb as p
    dim tbla as p
    dim tblb as p
    dim tblx as p

    tblx = table.current()

    'map all the field values you need first
    ra.afield1 = tblx.field1
    ...
    ra.afield8 = tblx.field8

    rb.bfield1 = tblx.field1
    ...
    rb.bfield12 = tblx.field12

    tbla = table.open(tablea)
    tbla.enter_record(ra)
    tbla.close()

    tblb = table.open(tableb)
    tblb.enter_record(rb)
    tblb.close()

    I would add a ui_beep() to it since it goes so fast you will think nothing happened!
    Last edited by MoGrace; 01-15-2017, 12:55 AM.

    Leave a comment:


  • Stan Mathews
    replied
    Re: Updating table takes 5 sec in a local PC setup.

    The script was designed to create a new record in another table based on the currently selected record in an already open table. As written it is not suitable to any other purpose so beware trying to adapt it to something else.

    Leave a comment:


  • MikeData
    replied
    Re: Updating table takes 5 sec in a local PC setup.

    Untimeable!!!
    It is now less than a second.
    Thanks Stan
    Time to revise all the others....
    Originally it was started using as an operation.
    In 'Operation' you only have append, post or import to add records.
    I have been using append all this time. Hell of improvement today.

    Leave a comment:


  • Stan Mathews
    replied
    Re: Updating table takes 5 sec in a local PC setup.

    There's no reason to do an append when all you want is to add a record. The query required by the filter in append.t_filter is what is slowing things down.

    Originally posted by MikeData View Post
    Revising based on Ronalds Idea
    I created script :
    DIM Append as P

    a_tbl = table.open("tableA")
    append.t_db = "tablex"

    append.m_key = ""
    append.t_key = ""
    append.m_filter = ""
    append.t_filter = "Acc=Var->gHx"
    append.type = "All"
    append.m_count = 8
    append.m_field1 = "name"
    append.m_exp1 = "@Ttablex->nameidLID"
    append.m_field2 = "Age"
    append.m_exp2 = "@tablex->Age1"
    ........to 8

    append.t_count = 0

    a_tbl.append()

    It took the same time.
    Try

    Code:
    a_tbl = table.open("tableA")
    b_tbl = table.current()
    a_tbl.enter_begin()
    a_tbl.name = b_tbl.nameidLID
    a_tbl.age = b_tbl.age1
    '''''' up to 8
    a_tbl.enter_end()
    a_tbl.close()

    Leave a comment:


  • Stan Mathews
    replied
    Re: Updating table takes 5 sec in a local PC setup.

    Mike,

    Why not go back to the beginning and describe what you are doing? Your thread title mentions updating (a kind of Alpha operation) but you aren't updating anything. Your initial description mentions posting (a kind of Alpha operation) but you aren't posting anything.

    So try to describe the situation where you do something on the form which adds a new record to two other tables. Do you have a script which adds the records? If so, show it to us.

    Leave a comment:


  • MikeData
    replied
    Re: Updating table takes 5 sec in a local PC setup.

    from a form using Tablex that is open(the source.)
    Tables A and B are not.

    Leave a comment:


  • MoGrace
    replied
    Re: Updating table takes 5 sec in a local PC setup.

    Are you doing this from a form where both tables are open and you can apply a filter? Or are you updating all those records?

    Leave a comment:


  • MikeData
    replied
    Re: Updating table takes 5 sec in a local PC setup.

    Revising based on Ronalds Idea
    I created script :
    DIM Append as P

    a_tbl = table.open("tableA")
    append.t_db = "tablex"

    append.m_key = ""
    append.t_key = ""
    append.m_filter = ""
    append.t_filter = "Acc=Var->gHx"
    append.type = "All"
    append.m_count = 8
    append.m_field1 = "name"
    append.m_exp1 = "@Ttablex->nameidLID"
    append.m_field2 = "Age"
    append.m_exp2 = "@tablex->Age1"
    ........to 8

    append.t_count = 0

    a_tbl.append()

    It took the same time.

    Leave a comment:


  • MikeData
    replied
    Re: Updating table takes 5 sec in a local PC setup.

    Thanks for the response, I see that other factors could come to play.
    Actually, I am not modifying, I am entering a new record in both table.

    Leave a comment:


  • Ronald Anusiewicz
    replied
    Re: Updating table takes 5 sec in a local PC setup.

    I guess the starting point would be indexing and looking at your code.
    Depending on what you are trying to do I think I would try:
    Table.open(mytable)
    Table.order(keyfield, filter the records that need to be updated)
    table.change_begin()
    my code to write the changes
    probably fetch first etc...
    table.change_end()
    Table.close()

    Leave a comment:

Working...
X