select 'create user '||f.serverlogin||' identified by values '||chr(39)||u.password||chr(39)||';' from supermag.smstaff f, user$ u where u.name=f.serverlogin; select 'create role '||f.orarole||' identified by values '||CHR(39)||u.password||CHR(39)||';' from supermag.smoffcfg f, user$ u where u.name=f.orarole; select 'grant '||chr(39)||u.orarole||chr(39)||' to '||f.serverlogin||';' from supermag.smstaff f, supermag.smoffcfg u where f.offindex=u.id; select 'grant SUPERMAG_USER to '||f.serverlogin||';' from supermag.smstaff f, supermag.smoffcfg u where f.offindex=u.id; select 'alter user '||f.serverlogin||' default role all except '||'"'||u.orarole||'"'||';' from supermag.smstaff f, supermag.smoffcfg u where f.offindex=u.id;