14 years ago
How to escape single quote in datasource?
Helllo support team,
I am using datasouce to query my expected results from the database that i can compare agains the results from the XML Response. This all works fine exept...
My issue is: I use the '${TESTSTEP#PROPERTY}' variable in my WHERE Clause in the datasource JDBC by using the 'Get Data...' option.
I want to know how i can replace a single quote that is stored in the variable or is there a option that does that automaticaly.
I am using a Oracle DB.
Sample :
with t as ( select 'L''BETTIOUI' as name from dual)
select
NAME,
replace( NAME,chr(39),chr(39)||chr(39)) NAME_REPLACED
from t
Result:
WHERE NAME = 'L'BETTIOUI' <-- Causes SQL Error by using the '${TESTSTEP#PROPERTY}' variable
Thanks,
Ramon
I am using datasouce to query my expected results from the database that i can compare agains the results from the XML Response. This all works fine exept...
My issue is: I use the '${TESTSTEP#PROPERTY}' variable in my WHERE Clause in the datasource JDBC by using the 'Get Data...' option.
I want to know how i can replace a single quote that is stored in the variable or is there a option that does that automaticaly.
I am using a Oracle DB.
Sample :
with t as ( select 'L''BETTIOUI' as name from dual)
select
NAME,
replace( NAME,chr(39),chr(39)||chr(39)) NAME_REPLACED
from t
Result:
WHERE NAME = 'L'BETTIOUI' <-- Causes SQL Error by using the '${TESTSTEP#PROPERTY}' variable
Thanks,
Ramon