RaghavendraK 70574
<[EMAIL PROTECTED]> wrote:
Subject: Re: Re: End of Search Notification to Collation function
i have one new collation function TestEq.
I register this with sqlite. Also provide a context
structure.

Now i write query as below,

select * from table where col = 'xxx' collate TestEq
and  col2='xxx' collate TestEq and col3='xxx' collate TestEq;

Now in the TestEq impl i need to know the column for
which am doing the comparison.

It's not clear why you would want that, but maybe something like this would work:

select * from table where col = '1xxx' collate TestEq
and  col2='2xxx' collate TestEq and col3='3xxx' collate TestEq;

The implementation of TestEq would look at the first character of the second argument and know which column is being used.

Alternatively, instead of a custom collation, implement a custom function taking three parameters and returning a boolean:

select * from table where TestEq(col, 'xxx', 1)
and  TestEq(co2, 'xxx', 2) and TestEq(col3, 'xxx', 3);

The last parameter again indicates which column is being handled.

Now most would suggest have different functions,but thats not
possible because table creation and ppl writing the query is dynamic
(not controlled by me). I can only bundle my TestEq function and
provide api desc abt what it does.

But why does it care which column it is acting on? What if it isn't a single column at all, e.g.

select * from table where col || ',' || col2 == 'xxx,yyy' collate TestEq;

Precisely what does it have to do differently when comparing col vs comparing col2 vs comparing some expression that cannot be traced to a single column?

So is there a way to get column
information for which am running the collate function?
it is logical to have the column names as part
of the collate function.

Except that a collation isn't always applied to a column. It can be applied to a pair of arbitrary expressions.

Second Part: Collate function needs a end of search notification,as
Collate function can do a re-drill down or up based on the saved
context.

Re-drill? This phrase doesn't make any sense to me, sorry.

Igor Tandetnik

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to