Skip to main content
ganeshbabuj
August 19, 2025
Question

Procedure MariaDb input parameter for where clause

  • August 19, 2025
  • 5 replies
  • 0 views

Trying to move the logic from query entity connecting to VW to Proc with input parameter and was able to create a Procedure on Maria DB . Challenge is trying to recreate includes operator logic for an column on proc using LIKE operator

but not able to achieve it 100%

currently got to an extend as below , there are multiple input paramter on WHERE clause and one below

AND ( input_parameter IS NULL OR input_parameter = '' OR REPLACE (LOWER(COLUMN_NAME),' ' , '')  LIKE REPLACE (LOWER(input_parameter),' ' , '') )

additional checks made

From Appian while passing the input parameter have also converted the input parameter to lower case and have appended %% before and after the string

Input parameter definition have set charset as per the column definition.

Still issue is value with alphanumeric value ending with number fails Ex: %abc1234_def4%. No result (actual record exists), but %abc1234_def% gives results 

5 replies

shubhama926776
August 19, 2025

Underscore (_) is a wildcard character in SQL LIKE patterns that matches exactly one character. When you search for %abc1234_def4%, the underscore is interpreted as a wildcard, not a literal underscore.

ganeshbabuj
August 20, 2025

can you provide with equivalent replacement string to be built on appian for Example : %abc1234_def4% to be passed as input parameter for Procedure 

shubhama926776
August 20, 2025

In Appian, you only need to escape underscores
Do not make any change to DB side and give a try.
Let me know if that works for you.

concat(
  "%",
  substitute(lower("abc1234_def4"), "_", "\_"),
  "%"
)


If this will not work give a try to make changes in DB as(Keep Above Appian Code as is for this)

AND ( input_parameter IS NULL OR input_parameter = '' OR 
      REPLACE(LOWER(COLUMN_NAME), ' ', '') LIKE 
      REPLACE(LOWER(input_parameter), ' ', '') ESCAPE '\\' )


If this doesn't work either, your data likely has trailing characters (spaces/tabs) after "4". Please verify the actual data structure.