ancillary operator

From: vinayak <vinayak_datar_at_yahoo.com>
Date: 17 Oct 2001 07:45:00 -0700
Message-ID: <69225f59.0110170644.343d49b5_at_posting.google.com>


In Oracle Data Catridge, we can write user defined operators which can be bound to a procedure OR function.
which in turn can be mapped to a c function ( as external procedure).

IF u got evrything i said skip following algo explanantion



create function foo
as external
name "foo_in_c"
library lib1

create operator op1 ..... using foo


i hope it's clear ( forget syntax , syntax is not a problem)

There is someting called as ancillary operator. (say anci_op1)that shares the context with op1.
anci_op1(num) is the only prototype allowed by oracle. now i can write



create function foo

create function anci_foo

CREATE OPERATOR op1 BINDING( VARCHAR2, VARCHAR2) RETURN NUMBER COMPUTE ANCILLARY DATA
USING foo

CREATE OPERATOR anci_op1
BINDING (NUMBER) RETURN NUMBER
ANCILLARY TO op1(VARCHAR2, VARCHAR2)
USING anci_foo


this all is working fine.

also, i can overload op1 as op1(varchar2,varchar2) and op1(num,num)


CREATE OPERATOR op1
BINDING( VARCHAR2, VARCHAR2) RETURN NUMBER COMPUTE ANCILLARY DATA
USING foo1,
(NUMBER, NUMBER) RETURN NUMBER
COMPUTE ANCILLARY DATA
USING foo2;


even this is working fine. it works fine since they have diff. signature.

so now the problem....

I have to connect anci_op1 to both of the operators. but there seems no way of doing that.( remember anci_op1(NUM) IS THE ONLY SINGNATURE POSSIBLE) for creating two op1 , we can have 2 "using" clauses to bind it to 2 different procedures.
Syntax of "ancillary to" seems allow for 2 op1 operaters but there is no support for 2 "using" clauses.


CREATE OPERATOR anci_op1
BINDING (NUMBER) RETURN NUMBER
ANCILLARY TO op1(VARCHAR2, VARCHAR2) , op1 (NUMBER,NUMBER) USING anci_foo1;????????


i am also attaching the link for create index syntax.

http://download-east.oracle.com/otndoc/oracle9i/901_doc/server.901/a90125/statements_65a.htm#2079784

which i guess can find in ANY oracle docs.

btw : it is mandatory that signature of the "functional implementation" of the op1 and anci_op1 MUST be same.

if you can help me to sort out this, it will b a great favour Received on Wed Oct 17 2001 - 16:45:00 CEST

Original text of this message