I'm not a sophisticated developer, as some of you already know, but maybe you could help me out with a rough design for this?
I would like to mimic the way airline reservation systems randomly generate unique record locators for their primary keys. None of the generated values can form obscene words, other specified values, or be a duplicate in an existing row, so a separate lookup table containing the prohibited values is required?
EDIT: Would it be better to populate a table with valid keys and randomly select a row which has not been updated with a key_already_used flag in order to generate the value, or should the value be randomly generated by a user-defined function, looked up to see if its not in the prohibited values table, then looked up to see if it has not already been inserted in the reservations table?