I have a table something like this
table1(int Id, varchar2() Name, varchar2() Details)
I am trying to build a predicate expression for the following SQL.
SELECT A.Id, A.Details, score(10) FROM table1 A WHERE CONTAINS (a.Details, 'abc',10) > 0 order by score(10) desc;
SudoCode:
IExpression containExression = new DbFunctionCall("Contains({0},'{1}', 10)",
new object[] {tabel1Fields.Details, "abc"});
var field = tabel1Fields.Details;
field.ExpressionToApply = containExression;
predicate.Add(field > 0);
IExpression scoreExp = new DbFunctionCall("Score(10)", new object[] {});
var field2 = tabel1Fields.Details;
field2.ExpressionToApply = scoreExp;
ISortClause scoreSortClause = new SortClause(field2, null, SortOperator.Descending);
scoreSortClause.EmitAliasForExpressionAggregateField = false;
ISortExpression sorter = new SortExpression(scoreSortClause);
Using this i was able to genrate query something like this
I tried this my resultant query looks something like this
SELECT A.Id, A.Details, score(10) FROM table1 A WHERE
CONTAINS (a.Details, 'abc',10) > 0 order by** score(10)()** desc;
but there was an extra brace at the end of score which throws unimplemented error in oracle
I even tried something like this
IExpression scoreExp = new DbFunctionCall("Score({0})", new object[] {10});
even this
IExpression scoreExp = new DbFunctionCall("Score(10)", null);
but
ORA-29909: label for the ancillary operator is not a literal number.
Think i cant bind variables in score or contains operator
Thanks for your help