Alpha Video Training
Results 1 to 18 of 18

Thread: Update of linking field becomes a mass. Why?

  1. #1
    Member René Stout's Avatar
    Real Name
    René Stout
    Join Date
    Oct 2003
    Location
    Tiendeveen, The Netherlands, Europe
    Posts
    529

    Default Update of linking field becomes a mass. Why?

    Hello!

    Ik keep struggling with A5, and I want to throw away Access so badly!

    Now this: I have a small test database with authors and books.
    Both are linked together through a set. I have troubles with lookups, but that is discussed in another topic. I switched it Off temporarily.

    Now I created an operation based on the set Authors => books. Before that I swithed Off the Auto Increment feature on Author_Id.
    I wanted to update the Author_Id. And look what happened:
    some authors got the same ID, which of course ruins my set.
    In the set you see that some books appear more than once.
    Sometimes the new Uthor_Ids seem to be triggered by the title, sometimes by the Author.
    What did I do wrong?

  2. #2
    Volunteer Moderator drgarytraub's Avatar
    Real Name
    Dr. Gary Traub
    Join Date
    May 2000
    Location
    Boca Raton, FL
    Posts
    2,784

    Default RE: Update of linking field becomes a mass. Why?

    I'll take a stab at this.

    When you create a one to many set, with authors-books, there will be a repeated author for every book linked to it. For example, if the author John Smith has 3 books then in the set, there will be 3 records for that author like:

    John Smith- Alice in Wonderland

    John Smith - Exodus

    John Smith - Watergate

    SO when you do an update on this set, I would expect that John Smith will get 3 different author_id's. See why?

    Thuis, to do what you want, just run an update on the author's TABLE, not the set.

    Hope this helps.

    Gary

  3. #3
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,311

    Default RE: Update of linking field becomes a mass. Why?

    Rene,

    I downloaded your file. there are no sets in the database.

    there are no update operations such as you describe.

    what am i missing?

    -- tom

  4. #4
    Member René Stout's Avatar
    Real Name
    René Stout
    Join Date
    Oct 2003
    Location
    Tiendeveen, The Netherlands, Europe
    Posts
    529

    Default RE: Update of linking field becomes a mass. Why?

    Gary, I tried this, but then in the Table Authors the IDs are changed, and in the table Books the Author links are lost, because there the old Author ID are still present. Or did I do something wrong?

    René

  5. #5
    Member René Stout's Avatar
    Real Name
    René Stout
    Join Date
    Oct 2003
    Location
    Tiendeveen, The Netherlands, Europe
    Posts
    529

    Default RE: Update of linking field becomes a mass. Why?

    Hi Tom,

    second try...

    René

  6. #6
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,311

    Default RE: Update of linking field becomes a mass. Why?

    Ok, I see your set.

    The update expression you're using involves a function I've never seen. Fetch_count(). The docs say it's obsolete and not supported. Why are you trying to use it?

    May I suggest that you describe what it is you're trying to do, so that we can offer suggestions that you can study?

    -- tom

  7. #7
    Member
    Real Name
    Richard Blanchard
    Join Date
    Apr 2000
    Location
    Providence, RI
    Posts
    69

    Default RE: Update of linking field becomes a mass. Why?

    Rene,
    I downloaded your file and did not see the set you referenced. When I opened the file Alpha indicated you are using the home version, so what I am seeing may not be the same. I created a set with tbl_020_books being the parent and tbl_010_authors being the child - a one-to-one link based upon the author_id field.

    The default browse for the set showed what I think you are referencing - the authors name is in both the Author_id and author fields. I changed the lookup in the tbl_020_books table - author_id field to display the author_id and now the default browse for the set shows the author id number and the authors name.

    I have built many sets and have never encountered this problem. It may be something with the home version. I just duplicated your tables and sets using the full version and everything seems to work correctly. I do not have to display the author_id in the lookup to have it properly disply on the set default browse.

    If you are not using the Home Version, there may be a problem with the installation. If you are using the Home Version, I do not know what the problem could be because I do not have that version.

    Good luck
    Dick Blanchard

  8. #8
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,311

    Default RE: Update of linking field becomes a mass. Why?

    Rene, another idea for you.

    Why not spend some time working through the tutorial ? It will help you get the grasp of the interface, and you'll find many of the expressions to work as you may have become accustomed to in Access.

    The AlphaSports sample application is a marvelous learning tool, and is very well explained in the related documentation. Look for 'AlphaSports Explained' in the Learning Center, if you haven't found it yet.

    -- tom

  9. #9
    Member René Stout's Avatar
    Real Name
    René Stout
    Join Date
    Oct 2003
    Location
    Tiendeveen, The Netherlands, Europe
    Posts
    529

    Default RE: Update of linking field becomes a mass. Why?

    Tom,

    I can't remember using the fetch count thing. I just used the Genie to
    1. update records
    2. Assign serial values
    3. Tell them to start from 101 with a prefix.

    That's all I did!

    I don't know why A5 used the fetch statements...


    About reading the manuals... That's the first thing I did, knowing that there's always more in it than you expect.

    I even printed out (and almost completely red already) the 200 somewhat page tutorial.

    I think I am too eager to try things rightaway on my ols Access applications and hav eto get used to the Alpha way of thinking.

    René

  10. #10
    Member René Stout's Avatar
    Real Name
    René Stout
    Join Date
    Oct 2003
    Location
    Tiendeveen, The Netherlands, Europe
    Posts
    529

    Default RE: Update of linking field becomes a mass. Why?

    Thanks, Richard,

    I do use the Home version...

    René

  11. #11
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,311

    Default RE: Update of linking field becomes a mass. Why?

    Rene,

    Gary was on the right track, then.

    There are several things that are likely to go wrong if you try to do a serial (sequential) update operation on link field values in your tables.

    1) if you run such an operation against a single table, each time a link field value is changed the link to the other table is broken. The new link field value no longer is the same as the link field value in the other table.

    2) if you run such an operation against a set of tables, the field value will increment on each fetch as the operation steps through the composite records in the set. A composite record is a sort of 'virtual' record consisting of the fields from the current primary table record AND the fields from the current child table record. If your primary table has one record in it, and your child table record has 4, then the set has 4 composite records. In all 4 of the composite records the primary table field values are the same. If you step through the composite records, one at a time changing link field values as you go, you can see that a big mess will occur, as the link field value in the one primary table record gets changed 4x.

    -- tom


  12. #12
    Member René Stout's Avatar
    Real Name
    René Stout
    Join Date
    Oct 2003
    Location
    Tiendeveen, The Netherlands, Europe
    Posts
    529

    Default RE: Update of linking field becomes a mass. Why?

    Tom,

    yes, I noticed that.
    The funny thing is (as far as I remember) that if you change it manually, things seem to work ok. You see the field changing in the child (composite) records, which they should do, being cascading.

    But when I run the operation, all goes wrong.

    Interesting.

  13. #13
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,311

    Default RE: Update of linking field becomes a mass. Why?

    Rene,

    You must have referential integrity enabled to see what you report. I have little experience using it, since I never enable it. While it's handy in a stand alone setting, it's a killer (in my opinion) in a networked environment.

    -- tom

  14. #14
    Member René Stout's Avatar
    Real Name
    René Stout
    Join Date
    Oct 2003
    Location
    Tiendeveen, The Netherlands, Europe
    Posts
    529

    Default RE: Update of linking field becomes a mass. Why?

    Tom,

    That's right, I use it quite often, especially when the linking field is not just a number, but an actual value which is subject to change. For my Serial Value Updating tests I switched it On.

    Other question:
    I imported the tables from Access, so their names.
    As a result of advise I shortened the table and set names.
    Now I'm stuck with the old names in the set edit window en in some more places. I read about aliases that A5 keeps its own bookkeeping. I cannot find the place to tell A5 what the new names are. I tried to duplicate them to shorter names, then removed the originals and updated the sets. Still the old names appear...

    René

  15. #15
    "Certified" Alphaholic Marcel Kollenaar's Avatar
    Real Name
    Marcel
    Join Date
    Apr 2003
    Location
    Twente
    Posts
    1,514

    Default RE: Update of linking field becomes a mass. Why?

    Hi Rene,

    Why don't you download the full demo?

    Marcel
    --------------------- Dutch --------------
    Hallo Rene,

    Waarom werk je niet met de volledige demo?

    Marcel

  16. #16
    Member René Stout's Avatar
    Real Name
    René Stout
    Join Date
    Oct 2003
    Location
    Tiendeveen, The Netherlands, Europe
    Posts
    529

    Default RE: Update of linking field becomes a mass. Why?

    Hi Marcel

    the full version is way over my budget

    --------------- dutch ---------------

    ietsiepietsie te duur voor huisgebruik...

    René

  17. #17
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,311

    Default RE: Update of linking field becomes a mass. Why?

    I think you can 'drop' the sets using the right click menu on any set object in the control panel. Before doing this, you probably should make a safety backup. -- tom

  18. #18
    Member René Stout's Avatar
    Real Name
    René Stout
    Join Date
    Oct 2003
    Location
    Tiendeveen, The Netherlands, Europe
    Posts
    529

    Default RE: Update of linking field becomes a mass. Why?

    Tom,

    After some experiencing I found the way to modify Serial fields to for instance R#### where the old value is filled in from the right. This works perfect, also in cascading situations. Why A5 uses the fetch statement, I don't know, It was generated by the Operation Creation Genie which I ordered to:

    update serial values, mask = 0000, prefix = R

    My (Working) solution is quite simple :
    new value is: "R"+right("0000"+val(Relatie_Id),4)

    René

Similar Threads

  1. Mass Configuration vs Individual
    By Scott Fisher in forum Alpha Five Version 6
    Replies: 6
    Last Post: 08-05-2005, 03:43 AM
  2. Set Linking Field
    By CapeMayAl in forum Alpha Five Version 6
    Replies: 5
    Last Post: 07-13-2005, 08:12 AM
  3. Linking Field
    By Ray in forum Alpha Five Version 5
    Replies: 8
    Last Post: 03-09-2004, 05:05 AM
  4. Linking field
    By 7ZNJABB in forum Alpha Five Version 4
    Replies: 7
    Last Post: 10-09-2001, 09:09 AM
  5. Linking Field Question
    By forskare in forum Alpha Five Version 4
    Replies: 11
    Last Post: 08-11-2001, 07:13 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
  •