SHARE
TWEET

Untitled

a guest Feb 14th, 2020 100 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. create or replace NONEDITIONABLE PROCEDURE LOGIN
  2. (
  3.   vUSERNAME IN VARCHAR2
  4. , vPASSWORD IN VARCHAR2
  5. , vSESSION_ID OUT VARCHAR2
  6. ) AS
  7.     vUSER_ID INT;
  8. BEGIN
  9.     SELECT Users.ID INTO vUSER_ID FROM Users WHERE username = vUSERNAME AND password = vPASSWORD;
  10.     IF vUSER_ID IS NOT NULL THEN
  11.         vSESSION_ID := DBMS_RANDOM.STRING('A', 10);
  12.         INSERT INTO Sessions(id, id_user, S_Start, S_Last) VALUES (vSESSION_ID, vUSER_ID, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
  13.     ELSE
  14.         vSESSION_ID := '0';
  15.     END IF;
  16.    
  17. END LOGIN;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top