Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6209305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:57:38+00:00 2026-05-24T05:57:38+00:00

What do you people use for generating unique account numbers? Some use Autoinc field,

  • 0

What do you people use for generating unique account numbers?
Some use Autoinc field, others something else…
What would be the proper way i.e to get an account number before I run the insert query?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T05:57:39+00:00Added an answer on May 24, 2026 at 5:57 am

    You haven’t told us what database system you are using, but from the sound of it, you’re talking about the Paradox tables in Delphi. If so, an autoInc column can work, although if I recall correctly, you have to be very careful when moving your data around with Paradox autoInc columns because they re-generate from zero when moved.

    As has been mentioned, you can use GUIDs – sysutils.function CreateGUID(out Guid: TGUID): HResult; – they will always be unique, but the downside in GUIDS is that ordering by these keys will not be intuitive and probably be meaningless, so you’ll need a timestamp column of some sort to maintain the order of your inserts, which can be important. Also, a GUID is a rather long character string and will not be very efficient for use as an account#, which assumedly will be a primary or foreign key in many tables.

    So I’d stick to autoInc if you want something automatic, but if you have to move data around and you need to maintain your original keys, load your original autoincs as integer columns in their new location or you could end up corrupting your entire database. (I believe there are other scenarios that also cause autoIncs to reset in Paradox tables – research this if it’s relevant – been a long time since I’ve used Pdox, and it may not be a problem with other flat file databases)

    If you are indeed using a database server – SQLServer, Oracle, Interbase, etc, they all have autoInc/indentity or generator functionality, sometimes in conjuction with a trigger – that is your best option.

    Dorin’s answer is also an excellent solution if you want to handle this yourself from within your Delphi code. Create a global, thread safe function to implement it – that will ensure a very high level of safety.

    HTH

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sometimes I see people use http://codepad.org as a way to quickly run/test their Perl
I've noticed in some coding people use icicle with the onCreate method, and I
I have seen people use addition where a bitwise OR would be more conceptually
I am just typing a salt and on php documentations, people always use some
Why would people use this format? Whats different between this and $a=2; $b=2; ?
People use gdb on and off for debugging, of course there are lots of
Why do people use enums in C++ as constants when they can use const
Do most people use .NET's SqlMembershipProvider, SqlRoleProvider, and SqlProfileProvider when developing a site with
What tricks do people use to manage the available memory of an interactive R
What Tools do you people use to work with Scala? For my learning phase,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.