Oracle / PLSQL: SIGN Function

This article is written about how to use the Oracle/PLSQL SIGN feature with syntax and examples.

Description

The Oracle/PLSQL SIGN function returns a fee indicating the signal of a number.

Syntax

The syntax for the SIGN characteristic in Oracle/PLSQL is:

SIGN( number )

Parameters or Arguments

number

The number to test for its sign.

Returns

If wide variety < 0, then the SIGN function returns -1. If quantity = 0, then the SIGN characteristic returns 0. If number > 0, then the SIGN characteristic returns 1.

Applies To

The SIGN feature can be used in the following versions of Oracle/PLSQL:

Oracle 12c, Oracle 11g, Oracle 10g, Oracle 9i, Oracle 8i

Example

Let’s look at some Oracle SIGN feature examples and discover how to use the SIGN function in Oracle/PLSQL.

For example:

SIGN(-23)
Result: -1

SIGN(-0.001)
Result: -1

SIGN(0)
Result: 0

SIGN(0.001)
Result: 1

SIGN(23)
Result: 1

SIGN(23.601)
Result: 1