home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.paradox      To crash or not to crash, asks Borland      9,834 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 9,497 of 9,834   
   Tom Krieg <"Please use the website to Kenneth   
   Re: a simpler way...?   
   08 Nov 08 13:30:20   
   
   Let's split the number into 2 parts, the "fixed" part (i.e. 4321, 4322   
   etc) and the "increment" part (1,2,3,4).   
      
   My suggestion is to create a table with 2 fields, "Fixed" and "Last   
   Increment", where "fixed" is the primary key.   
      
   When you create a new key, create a new record in this table and set the   
   increment to 1. When you create another record for the same "fixed"   
   part, just qlocate the appropriate record using a tcursor and add 1 to   
   the increment.   
      
   Kenneth wrote:   
   > On Sat, 08 Nov 2008 11:35:39 +1100, Tom Krieg <"Please use   
   > the website contact form"> wrote:   
   >   
   >> Does the incremental part of the key revert back to 1 when the other   
   >> part changes? I.e. when the other part of the key changes to 4322, does   
   >> the sequence revert back to 43221, 43222, etc?   
   >>   
   >> If that's the case, I would suggest a table with a record for every   
   >> generated key (4321, 4322 etc) being the primary key with a field   
   >> containing the last incremental number used for that main number.   
   >   
   > Hi again,   
   >   
   > Yes, the incremental part was to revert back to "1."   
   >   
   > As it happens, I have another approach that has solved my   
   > problem, but I am still curious about your suggestion above.   
   >   
   > But, with regret, I do not understand your suggestion as   
   > written.   
   >   
   > Could you please describe the idea in that closing paragraph   
   > another way?   
   >   
   > Many thanks,   
      
      
   --   
   Tom Krieg   
      
   ---------------   
   http://www.krieg.com.au   
   Please use the contact page to contact me via email   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca