Use SIGN in PL/SQL statement : SIGN « Numeric Math Functions « Oracle PL / SQL






Use SIGN in PL/SQL statement

 
SQL>
SQL> set serveroutput on
SQL>
SQL> BEGIN
  2     DBMS_OUTPUT.PUT_LINE(SIGN(3.5));
  3     DBMS_OUTPUT.PUT_LINE(SIGN(-3.5));
  4     DBMS_OUTPUT.PUT_LINE(SIGN(0));
  5  END;
  6  /
1
-1
0

PL/SQL procedure successfully completed.

SQL>
SQL>

 








Related examples in the same category

1.SIGN: Returns 1 if the argument is positive, 0 if the argument is negative
2.SIGN(0)
3.-SIGN(x): Returns -1 if x is negative, 1 if x is positive, or 0 if x is zero
4.SIGN(5)
5.Use sign function in user-defined function
6.select sign( 100 - ( 50 * 2 ) ) "Using expressions"
7.select sign( 123 * -1 + 122) "Using expressions"