Skip to Content
avatar image
Former Member

AutoComplete with Odata

Is there any simple way which I can use with Odata for AutoComplete ( I cannot use sp (stored procedure) directly with odata serivces that is what i am reading on so many discussing that sp has to be rap with cal view)

Below snapshot is of google search but similar search page i have created with jdbc connection

I have created a sp "get_AUTO" for jdbc which is working fine

drop procedure "a"."get_AUTO";
CREATE PROCEDURE "a"."get_AUTO" (in generic VARCHAR(100)) LANGUAGE SQLSCRIPT AS 
Begin
SELECT GENERIC 
FROM(
SELECT DISTINCT 
  SCORE() AS score,
    CASE
      WHEN "a"   like :generic   then "a"
  WHEN "b"   like :v_par   then "b"
  WHEN "c"   like :v_par   then "c"
    else "d" end GENERIC
FROM    "a"."cust"
  WHERE CONTAINS("SEARCH_STRING",:generic, FUZZY(0.8, 'spellCheckFactor=0.8')) )A 
ORDER BY score DESC;
END;

Please help if possible in detail how to use aforesaid sp with odata...

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jul 08, 2014 at 06:24 PM

    I believe you have already answered your own question within the posting.  In order to use stored procedures in XSODATA services, you wrap them in a Calculation View.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Thomas Jung

      In odata itself there is a function called search but it gives me string for all the fields in the table can't we restrict to the field which matches the input character??