Skip to Content
avatar image
Former Member

Fuzzy Search in Subquery - Error

Hello, I have some problems. I'm new on SAP Hana. I'm trying to get list of product data. But I want to change product names with the other table matched product name. Because we have dirty product name such as "SAAP", "sap hanA".

I want to change this name fields with the correct ones. I tried to find with Fuzzzy search but I got some errors.

select top 1000 prd."Status",

(

select prd2."NAME1"

from "PRD1_Test" as prd2

where contains(prd2."NAME1", prd."NAME2", FUZZY(0.8))

) as ProductName

from "PRD_Test" as prd

Error:

Could not execute 'select top 1000 prd."Status", ( select prd2."NAME1" from "PRD1_Test" as prd2 ...' SAP DBTech JDBC: [8]: invalid argument: The second argument cannot include any column: line 5 col 33 (at pos 144)

SQL
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Sep 25, 2017 at 04:25 AM
    -1

    As the error message indicates, the CONTAINS() predicate does only allow a string value, but not a column in the <search_string> parameter.

    That's also documented: https://help.sap.com/viewer/4fe29514fd584807ac9f2a04f6754767/2.0.02/en-US/20f952437519101487edc3d9aba84238.html

    What you want to do here is usually called "master data cleansing" and typically not done on an ad hoc basis.

    Instead, smart data quality (SDQ) provides tools to create data loading processes that cleanse the data once so that you can use clean data from there on.

    Add comment
    10|10000 characters needed characters exceeded