Charter Field with increment ID

  • Hello everyone,

    I am trying to create a table with ID field which increment automatically.  ID must be 6 charters contain both letters and numbers (A00A00)

     

    i.e.  A00A00, A00A001 ….. A00A99, A00B01 and so on

     

    I try to generate and update table with unique ID s by writing a trigger and updating ID field by calling a function.  This work fine when I try to insert a single row, but I am having problem updating ID when trying to insert multiple rows at same time i.e. inserts into statement.

     

    The function (which calculate next id), check same table, find last ID value and increment the id according to formula.  The main problem with multiple rows is that there is no way to know which last ID was used.  Is there any other way to create a column with increment charters ID, which following ( i.e.  A00A00, A00A001 ….. A00A99, A00B01 and so on) format? 

     

    Note: ID must be 6 charters contain both letters and numbers (A00A00)

  • Please do not cross-link.  Your question will get answered. 

    Cross Link

    I wasn't born stupid - I had to study.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply