Product: TIBCO Spotfire®
How to prevent the backslash character (\) from being escaped in a Parameterized Information Link.
Product: TIBCO Spotfire (desktop client / Analyst / Professional)
Version: All supported versions
OS: All Supported Operating Systems
--------------------
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.
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
backslash, escape, parameter, parameterized, information link, backslash removed, regexp, regular expression, regex_parameter, REGEXP_INSTR, four backslashes
Comments
0 comments
Article is closed for comments.