i am writing a database program and i want to generate item codes so that all the item will be identified by this code.

the items are in categories examples (soft-drinks,wines beers ....etc )

i want to crate a function the will generate this codes for me. example a category (Array) is wines all the item codes in Wine in the Array Wine should begin with the word 'W' if it is Beers all the items codes in the Array Beer must begin with' B'.

thank u