I am using oracle 11g and I just cant under stand where my problem is. I have made much more difficult stuff but I fail in this simple thing for the last 5 hr :
Thi
Given that you are calling this within SQL, you could use the built-in SIGN function instead of rolling your own.
The function will return -1, 0 or 1, depending on the sign of the parameter (negative, zero or positive respectively).
Here's how you would use it:
SIGN(level_existance*types_with_impel)
And how you would work it into a CASE statement:
SELECT CASE WHEN (SIGN(level_existance*types_with_impel) = 1)
THEN 'TRUE'
ELSE 'FALSE'
END legal_user
FROM ...
In this case, I'm just returning a string ('TRUE' or 'FALSE'), but you can return anything that's valid within your SELECT statement (a column, SYSDATE, etc).