advanced code snippet search
geekzspot on 10/30/12
10/30/12 03:45am
Boolean "if exists" Function
CREATE OR REPLACEFUNCTION email_exists(email_in IN employees.email%TYPE) RETURN BOOLEAN IS counter INTEGER;BEGIN SELECT COUNT(*) INTO counter FROM employees WHERE email = email_in AND ROWNUM <= 1; -- If exists at least one (1) RETURN ( counter > 0 ); -- Will return boolean True or False END email_exists;
Report this snippet Tweet
Comment:
You need to login to post a comment.