Let me preface this by saying that I am new to HANA and "fuzzy search" as well. Any thoughts or suggestions on the below info would be greatly appreciated.
I am creating a procedure where I am trying to search a table and match vendors using fuzzy search. The code is below. It gets created like this without issue. When I try to invoke it I get the following error:
Could not execute 'CALL "SOURCE_SABA"."SEARCH_VENDOR_MSTR" (3)' in 202 ms 389 µs .
SAP DBTech JDBC: [383]: invalid identifier: [383] "SOURCE_SABA"."SEARCH_VENDOR_MSTR": line 15 col 10 (at pos 277): [383] (range 3) invalid identifier exception: invalid identifier: DS2HANA: line 2 col 134 (at pos 219)Please check lines: 19,
Couple of comments:
1. I have the declare for variable v_supp_name commented out. If I uncomment this and try to create it then an error is thrown that I cannot use a scalar variable where it is used (after the while).
2. The identifier mentioned above (DS2HANA) is the ID under which I am running the proc.
3. Line 19 which is mentioned at the end of the error message is highlighted in red below. I am wondering if this is having an issue with the contains itself.
4. All of the fields involved in the search are varchar(100).
5. The parameter being passed in is for the number of rows to use from the input file.
CREATE PROCEDURE"SOURCE_SABA"."SEARCH_VENDOR_MSTR" (in supp_count int)
LANGUAGE SQLSCRIPT
SQL SECURITY INVOKER
AS
BEGIN
declare v_rowcount int;
--declare v_supp_name varchar(100);
while v_rowcount <= supp_count DO
v_supp_name = SELECT"SUPPLIER_STANDARDIZED"FROM"SOURCE_SABA"."SPS_SUPPLIER_CLEANSED"where ROW_NUMBER = v_rowcount);
v_supp_data = SELECT ROW_NUMBER, "SUPPLIER_STANDARDIZED"FROM"SOURCE_SABA"."SPS_SUPPLIER_CLEANSED"where ROW_NUMBER = v_rowcount);
v_vend_data = SELECT v_rowcount, "Vendor Master_STANDARDIZED", SCORE() AS SCORE FROM"SOURCE_SABA"."SPS_VENDOR_CLEANSE"
WHERE CONTAINS(Name1, :v_supp_name, FUZZY(0.8))
ORDERBY score DESC);
insertinto"SOURCE_SABA"."SPS_SUPPLIER_FUZZY_MATCH"
SELECT A."SUPPLIER_STANDARDIZED", B."Vendor Master_STANDARDIZED", B.SCORE
FROM :v_supp_data A, :v_vendor_data B
WHERE A.ROW_NUMBER = B.v_rowcount);
v_rowcount := v_rowcount+1;
endwhile;
end;
Thanks,
Ken