Use function to check passwords : Function Return « Stored Procedure Function « Oracle PL / SQL






Use function to check passwords

    

SQL>
SQL> CREATE OR REPLACE FUNCTION myFunction(in_username IN VARCHAR,in_new_password IN VARCHAR,in_old_password IN VARCHAR)
  2  RETURN BOOLEAN
  3  AS
  4      pwd_okay BOOLEAN;
  5  BEGIN
  6      IF in_new_password = in_username THEN
  7         raise_application_error(-20001, 'Password may not be username');
  8      END IF;
  9      RETURN TRUE;
 10  END myFunction;
 11  /

Function created.

SQL>

   
    
    
    
  








Related examples in the same category

1.Return varchar2 value from function
2.Function return Integer
3.Return value from a function
4.Use function return value in select statement
5.Save the returning value from a procedure to a variable
6.RETURN statement.
7.Multiple RETURN Statements
8.Return a type
9.Concatenates two strings into one:
10.Return a varray from a function
11.Append result from generator function to a table
12.We use user function in DML statements
13.This script demonstrates using a record type as a function return value
14.Use user-defined function to combine and format columns