Excerpt from your comment on @ ajmalmhd04 answer
I really want to use my operator as inline (=, + ...)
Yes, the documentation is a bit confused about how it defines user-defined statements, especially this part:
user-defined operators act as built-in operators, such as <,> and =;
Unfortunately, this means that you can use custom operators, where (basically) you can use built-in operators, but not in the same way (e.g. operand1 OPERATOR operand2 ), you use built-in operators such as < or = . Custom operators, if you donβt look at them very closely, are different ways of calling functions, except that they (operators) can only be used in DML statements ( select , insert , etc.). You cannot directly use them in PL / SQL, only through DML. So something like this in PL / SQL will result in PLS-00548: invalid use of operator.
if operator(<<arguments>>) = 1 then -- something end if;
The advantages of creating and using operators if you are not involved in the development of server-based applications, extensions (data cartridges), for example, types of indexes that are not displayed to me personally. You cannot think of a situation where you can use operators and cannot use functions. However, the opposite is not true. You can look at the ability of an operator to have multiple bindings as a way of using it as an overloaded function. But on the other hand, you can easily achieve the same with packages.
source share