cancel
Showing results for 
Search instead for 
Did you mean: 

AutoComplete with Odata

former_member290321
Participant
0 Kudos

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...

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

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.

former_member290321
Participant
0 Kudos

How that's the issue, I have been watching your videos and hats off to you to explain in such a great length but I have not seen in those videos or in any discussion actually addressing or showing how to rap sp in cal view, if you can please create a video for aforesaid if not please guide step by step how to rap the stored procedure with cal view...

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

There isn't much to it. Just create a scripted calculation view. Within the logic of that calculation view place the CALL to your stored procedure.  The 'hardest' part is recreating the interface of the stored procedure on the calculation view.  But that's only hard from the standpoint of having to re-type the parameters.

former_member290321
Participant
0 Kudos

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??

Answers (0)