Auto create unique ID for a database entry
Posted on 2011-09-20
I have a table which contains references to blocks within supermarkets. The code for these blocks uses a type of telephone type code:
This code = United Kingdom, London, Store 006, S = Supermarket and AA11 is the block code.
These codes are printed on forms so the person reading it can understand 'in English' where this block is located. I should mention that my term 'block' refers to a display in a supermarket, the cereal block, the coffee block, the shampoo block etc.
What I need to try to do though is also have a second code for this block, something that is shorter than xxx-xx-xxx-X-xxxx. Our merchandisers are going to start takin gpictures of these blocks on a 'PDA' and in order for us to initially identify the block is by typing in the full code, they take a picture, name it then send it to our server to break the code down again. My problem is that 1 - they have around 40 blocks to enter per 6 stores they visit each day and 2 - they will type the code wrong, I just know it! If the code doesn't come in to the system properly then our report will not be able to find the picture.
The most blocks we will ever have in one country is 99,999. is it possibe to create an automatically created unique 5 digit alphanumeric code that is just added when we add the main code for this block in our database or am I thinking way off the mark here?
BY32S (as an example)
Any help would be much appreciated.