View Single Post
  #1 (permalink)  
Old April 22nd, 2004, 10:02 PM
Fireball Fireball is offline
Registered User
 
Join Date: Apr 2004
Location: Portland, Oregon, USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Oracle Boolean Datatype

If I want to create a function that checks if an employee number exists then check if that employee is a manager Returning a BOOLEAN to my procedure . . .

How would I do that, I am learning and everything I seem to try I am getting errors.

Create function (in parm)
return boolean;
IS
VARIABLE
BEGIN
SELECT EMPNO INTO VARIABLE
FROM EMP
WHERE EMPNO = VARIABLE;

IF VARIABLE EQ EMPNO AND JOB NE MGR THEN
RETURN(TRUE)
ELSIF
VARIABLE EQ EMPNO AND JOB EQ MGR THEN
RETURN (FALSE)
ELSIF RETURN (FALSE)