suggest a username query
555805Jan 11 2007 — edited Jan 13 2007Here is a fun one, for which I'm hoping there is a short and fast answer -
I'd like to make a username suggestion stored procedure. The input is IN_K_Username Varchar2(50). The procedure would output the first username that looks like dgarcia1 or dgarcia2 etc that is not found in the table K_Users. If IN_K_Username contains numbers at the end (such as dgarcia1234), they should be truncated before looking for a suggestion.
This procedure would only be called if the username the user originally wanted (IN_K_Username) was already taken, so I don't need to check for that.
I'm just starting with PL/SQL so any hints will be greatly appreciated! We are using Oracle 9i (or something like that).