CREATE [ OR REPLACE ] OPERATOR
[ schema. ] operator binding_clause ;
binding_clause::=
BINDING
(parameter_type [, parameter_type ]...)
RETURN return_type
[ implementation_clause ]
using_function_clause
[, (parameter_type [, parameter_type ]...)
RETURN return_type
[ implementation_clause ]
using_function_clause
]...
implementation_clause::=
{ ANCILLARY TO primary_operator
( parameter_type [, parameter_type ]...)
[, primary_operator
( parameter_type [, parameter_type ]...)
]...
| context_clause
}
context_clause::=
[ WITH INDEX CONTEXT,
SCAN CONTEXT implementation_type
[ COMPUTE ANCILLARY DATA ]
]
[ WITH COLUMN CONTEXT ]
using_function_clause::=
USING [ schema. ] [ package. | type. ] function_name
Example
CREATE FUNCTION eq_f(a VARCHAR2, b VARCHAR2) RETURN NUMBER AS
BEGIN
IF a = b THEN RETURN 1;
ELSE RETURN 0;
END IF;
END;
/
CREATE OPERATOR eq_op
BINDING (VARCHAR2, VARCHAR2)
RETURN NUMBER
USING eq_f;