Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE USER "Kyle" PROFILE "DEFAULT" IDENTIFIED BY "password" ACCOUNT UNLOCK
- WHERE NOT IN //Also tried 'WHERE NOT EXISTS'
- (
- SELECT username FROM all_users WHERE username = 'Kyle'
- )
- IF NOT EXISTS
- (SELECT name FROM master.sys.server_principals
- WHERE name = 'Kyle')
- BEGIN
- CREATE LOGIN Kyle WITH PASSWORD = 'temppassword' MUST_CHANGE, CHECK_EXPIRATION=ON, CHECK_POLICY=ON
- END
- declare
- userexist integer;
- begin
- select count(*) into userexist from dba_users where username='SMITH';
- if (userexist = 0) then
- execute immediate 'create user smith identified by smith';
- end if;
- end;
- /
- SELECT count(*) INTO v_count_user
- FROM all_users
- WHERE username = 'Kyle'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement