In Oracle, use SIGN function to check if the number is negative, zero or positive. Below is an example to how to check if the number is negative in Oracle.
SIGN Function Example
SET SERVEROUTPUT ON; DECLARE n NUMBER := -5; BEGIN IF SIGN (n) < 0 THEN DBMS_OUTPUT.put_line ('Number is negative.'); ELSIF SIGN (n) = 0 THEN DBMS_OUTPUT.put_line ('Number is zero.'); ELSE DBMS_OUTPUT.put_line ('Number is positive.'); END IF; END; /
Number is negative. PL/SQL procedure successfully completed.