Method Community

 

Table RecordId

Last post 11-03-2009 8:00 AM by Joe. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 11-02-2009 8:47 AM

    • Joe
    • Top 50 Contributor
    • Joined on 08-17-2009
    • Posts 97

    Table RecordId

    Hi.

    When we have a table that is 5 records long,

    RecordID   Letter

    1                     A

    2                     B

    3                     C

    4                     D

    5                     E

    why is it that deleting a record, such as record 4, that the record numbers do not change to say 1-4 ?.

    (1) If  a table row four is deleted, the record numbers are listed as follows: 1,2,3,5 instead.

    (2) Is the recordId not the  true record number from the physical table,

    (3) or is this 4th record remaining as stored but not shown? ..

    (5) I was intending to use the highest record id to indicate the number of records in the table but that doesnt seem to be a valid use anymore. For now i'll look into making a count variable with the loop through table action.

    Thx,

    Joe.

  • 11-02-2009 4:29 PM In reply to

    Re: Table RecordId

    Answer

    Hi Joe,

    The record ID for a table serves as a unique identifier for that particular record and cannot be reused. Think of the record ID as a permanently bound unique ID for a newly added record.

    Newly added records will always have a record ID of the last record ID generated incremented by 1. Deleting a record will permanently remove the record from the table but will not affect existing or future record IDs.
     
    You can easily get the number or records (count) in a table by using the Retrieve Value from table for the record ID field where the record ID is greater than 0. Beside the option for If multiple results: select ‘Retrieve Count’.

    Hope that helps,

    Need more help? Ask us about Method consulting services.

    Valbon Shabani
    Director of Education
    Method Integration Inc.
    Toll Free: 1.888.925.6238 ext. 715
    Local and overseas: 416.847.0400 ext. 715
    Fax: 416.640.6027
    E-mail: valbon@method.me
    Website: http://www.linkedin.com/in/valbon
  • 11-03-2009 8:00 AM In reply to

    • Joe
    • Top 50 Contributor
    • Joined on 08-17-2009
    • Posts 97

    Re: Table RecordId

    Soooo if the recordId never changes .. what happens when more records have been created over the years than possible to store in a 32 (or possibley 64 bit) value... though even 32 bit will hold up to around 4 billion in a single register, an ongoing program will eventually blow through this with daily use, if deleted recordId's can never be resused.. I suppose i'm getting ahead of myself and away from the original question.

    So in short,

    Thanks Val - that did answer my question =).

    ~Joe

Page 1 of 1 (3 items)