Skip to Content
author's profile photo Former Member
Former Member

Autoincremental database fields

Hello,

I am looking for a way to create autoincremental fields as keys in database tables. It should be a method like "generateID". Each call to "generateId" shall return a unique number which was incremented before. It should work in a multiuser environment, where multiple user demand simultaneously unique id's before creating new records in a table. Furthermore, it should be independent from which database I use and it should be maintainable in the Netweaver Developer Studio.

In several tutorials from SAP e.g. QuickCarRental, there is provided a method "generateID()" which works with a timestamp or so. The authors of the tutorials recommend, NOT to use such a functionality in live systems environments: "Make sure that the method used here, generateId(), is not used to implement an ID in a live system. In this case, we are simply simulating generating an ID. In a live system, always use the correct ID generation process."

But, what is the correct ID generation process ?

Thanks in advance

Andreas

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Oct 11, 2005 at 07:57 AM

    Hello Andreas,

    Take a look to this external article http://www.jguru.com/faq/view.jsp?EID=1030397

    It might help you.

    Regards.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.