I have various strings in a table in SQL Server/Oracle db, like this:
String1
String2
String3
I need to convert them in to positive integers say some thing like:
String1 = 12
String2 = 25
String3 = 45
I am not expecting the numbers in any order. Only requirement is number generated for one string should not conflict with other. Either new strings can be inserted into the table or old strings can be deleted. Now later if I do not have 2nd string instead there is a new string
String1 = 12
String3 = 45
String4 = 28
Note that the number 25 generated for 2nd string earlier can not be used for the new string. Using extra storage (temp tables) is not allowed. I used row_number function but later on realized that the integers generated with this function will get changed when new strings are inserted (as order of strings will change)
Note: My strings are 128 bit GUIDs.
Note: If I am allowed to use a table (Unique Integer - GUID mapping) at my local server (not at client's machine), how can I make sure that new GUID strings are not allocated the integer assigned earlier ?
Any inputs to solve this problem will be appreciated.