<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://mailnest.com/dbawiki/index.php?action=history&amp;feed=atom&amp;title=Generate_random_password</id>
		<title>Generate random password - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://mailnest.com/dbawiki/index.php?action=history&amp;feed=atom&amp;title=Generate_random_password"/>
		<link rel="alternate" type="text/html" href="https://mailnest.com/dbawiki/index.php?title=Generate_random_password&amp;action=history"/>
		<updated>2026-04-04T08:31:30Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.29.3</generator>

	<entry>
		<id>https://mailnest.com/dbawiki/index.php?title=Generate_random_password&amp;diff=323&amp;oldid=prev</id>
		<title>Stuart: Created page with &quot;&lt;pre&gt; create or replace FUNCTION get_random_password(p_password_format IN VARCHAR2) RETURN VARCHAR2 IS      format_len    NUMBER        := LENGTH(p_password_format);         /...&quot;</title>
		<link rel="alternate" type="text/html" href="https://mailnest.com/dbawiki/index.php?title=Generate_random_password&amp;diff=323&amp;oldid=prev"/>
				<updated>2013-01-08T11:49:35Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;pre&amp;gt; create or replace FUNCTION get_random_password(p_password_format IN VARCHAR2) RETURN VARCHAR2 IS      format_len    NUMBER        := LENGTH(p_password_format);         /...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
create or replace FUNCTION get_random_password(p_password_format IN VARCHAR2) RETURN VARCHAR2 IS&lt;br /&gt;
     format_len    NUMBER        := LENGTH(p_password_format);&lt;br /&gt;
        /****************************************&lt;br /&gt;
         * Template characters                  *&lt;br /&gt;
         ****************************************&lt;br /&gt;
         * U = upper case alpha characters only, strip off O and I (look the same in certain font as 0 and 1) *&lt;br /&gt;
         * L = lower case alpha characters only, strip off O and I (look the same in certain font as 0 and 1) *&lt;br /&gt;
         * A = mixed case alpha characters only, strip off O and I (look the same in certain font as 0 and 1) *&lt;br /&gt;
         * N = numeric characters              , strip off 0 and 1 (look the same in certain font as O and I) *&lt;br /&gt;
         * ? = NON-alpha characters     #_$    , limit to the ones that no require double quotes              *&lt;br /&gt;
         ****************************************/&lt;br /&gt;
     password_string VARCHAR2(132) := NULL;&lt;br /&gt;
     FUNCTION get_char(p_char IN VARCHAR2) RETURN VARCHAR2 IS&lt;br /&gt;
        FUNCTION get_random_char(p_string IN VARCHAR2) RETURN VARCHAR2 IS&lt;br /&gt;
        BEGIN&lt;br /&gt;
            RETURN(SUBSTR(p_string,DBMS_RANDOM.VALUE(0,LENGTH(p_string)),1));&lt;br /&gt;
        END get_random_char;&lt;br /&gt;
     BEGIN&lt;br /&gt;
        IF    (p_char = &amp;#039;U&amp;#039;) THEN RETURN(get_random_char(&amp;#039;ABCDEFGHJKLMNPQRSTUVWXYZ&amp;#039;));&lt;br /&gt;
        ELSIF (p_char = &amp;#039;L&amp;#039;) THEN RETURN(get_random_char(&amp;#039;abcdefghijklmnopqrstuvwxyz&amp;#039;));&lt;br /&gt;
        ELSIF (p_char = &amp;#039;A&amp;#039;) THEN RETURN(get_random_char(&amp;#039;ABCDEFGHJKLMNPQRSTUVWXYZabcdefghjklmnopqrstuvwxyz&amp;#039;));&lt;br /&gt;
        ELSIF (p_char = &amp;#039;N&amp;#039;) THEN RETURN(get_random_char(&amp;#039;23456789&amp;#039;));&lt;br /&gt;
        ELSIF (p_char = &amp;#039;?&amp;#039;) THEN RETURN(get_random_char(&amp;#039;#{}[]\|=+-*&amp;lt;&amp;gt;:_$&amp;#039;));&lt;br /&gt;
        ELSE RETURN(NULL);&lt;br /&gt;
        END IF;&lt;br /&gt;
     END get_char;&lt;br /&gt;
  BEGIN&lt;br /&gt;
     password_string := NULL;&lt;br /&gt;
     -- check password_format&lt;br /&gt;
     IF (p_password_format IS NULL) THEN&lt;br /&gt;
        -- if no password_format is specified, we will return DUMMY as password&lt;br /&gt;
        RETURN(&amp;#039;DUMMY&amp;#039;);&lt;br /&gt;
     ELSE&lt;br /&gt;
        &amp;lt;&amp;lt;read_format_char&amp;gt;&amp;gt;&lt;br /&gt;
        FOR i IN 1..format_len LOOP&lt;br /&gt;
           password_string := password_string || get_char(SUBSTR(p_password_format,i,1));&lt;br /&gt;
        END LOOP read_format_char;&lt;br /&gt;
        RETURN(password_string);&lt;br /&gt;
     END IF;&lt;br /&gt;
  END get_random_password;&lt;br /&gt;
/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>	</entry>

	</feed>