How to prevent the backslash character (\) from being escaped in a Parameterized Information Link.

How to prevent the backslash character (\) from being escaped in a Parameterized Information Link.

book

Article ID: KB0080020

calendar_today

Updated On:

Products Versions
Spotfire Analyst All Versions

Description

If you create an Information Link that has an input parameter defined, passing it a string with the backslash character (\) may cause the backslash character to be removed. 

The Information Link SQL query shown in the following example has the input parameter in the WHERE clause:

SELECT
   R1."TEXT" AS "TEXT"  FROM  "DBUSER"."REGEX1" R1
WHERE
   ?regex_parameter

If you specify a regular expression as the input parameter value for the ?regex_parameter, like this:

- REGEXP_INSTR(TEXT, '+@\w+(\.\w+)+') > 0 

then the parameter value will get passed as:

- REGEXP_INSTR(TEXT, '+@w+(.w+)+') > 0 because all of the backslash characters get removed. 

This can be verified in the sql.log file in the TIBCO Spotfire Server logs folder.

Environment

All Supported OS

Resolution

Use 4 slashes "\\\\" for each literal "\" character, as in the expression shown below:

--  REGEXP_INSTR(TEXT, '+@\\\\w+(\\\\.\\\\w+)+') > 0

This will be resolved as the desired expression, with one backslash in each intended position in the string:

--  REGEXP_INSTR(TEXT, '+@\w+(\.\w+)+') > 0

Issue/Introduction

How to prevent the backslash character (\) from being escaped in a Parameterized Information Link.