AnsweredAssumed Answered

SQL Param string not working

Question asked by Colum on Dec 2, 2016
Latest reply on Dec 5, 2016 by Colum

I have a gel script that uses a query to select resources in a specific OBS. That OBS is entered via a parameter on the script. If I use a string as the parameter value I get no rows returned. If I use a number I get rows. Any idea what I am doing wrong? When I enter parameter in process I enter it in single quotes eg 'Corp Fin'.

Here are relevant snippets for string:

<gel:parameter default =""Corp Fin'" var="obslevel3"/>

 <sql:query escapeText="0" var="results">
   <![CDATA[

SELECT...

FROM ...

...WHERE NBI_DIM_OBS.LEVEL3_NAME = ? 
]]>
<sql:param value="${obslevel3}"/>
</sql:query>

 

Here are relevant snippets for number:

<gel:parameter default="5105001" var="obslevel3"/>

<sql:query escapeText="0" var="results">
   <![CDATA[

SELECT...

FROM ...

...WHERE NBI_DIM_OBS.LEVEL3_UNIT_ID = ?  
]]>
<sql:param value="${obslevel3}"/>
</sql:query>

Outcomes