In Oracle PL/SLQ,, the ORDER method is one of the member methods used in the Oracle Object Relational Model to order variables of an object type. It compares the values of two objects based on criteria you specify. One of these objects is SELF while the other one is a parameterized object belonging to the same object type. Based on a comparative condition it returns numeric values -1 (less than), 0 (equal), or +1 (greater than).
Do not confuse ORDER with ORDER_BY; they are completely different terms with different meanings and applications.
ORDER MEMBER FUNCTION [METHOD NAME] ( [TYPE PARAMETER] )
CREATE OR REPLACE TYPE TYP_ORD AS OBJECT (
ORDER MEMBER FUNCTION SORT (P TYP_ORD) RETURN INTEGER );
CREATE OR REPLACE TYPE BODY TYP_ORD AS
ORDER MEMBER FUNCTION SORT(P TYP_ORD) RETURN INTEGER IS
IF L_NUM1 < P.L_NUM1 THEN
ELSIF L_NUM1 > P.L_NUM1 THEN
Related Code Snippets:
- ORDER BY Clause - The ORDER BY clause is used by, and is the last clause of, a SELECT statement.