title: HANA - Passing string variable into WHERE IN() clause in SQL script
body: <p>Lets suppose I have some SQL script in a scripted calculation view that takes a single value input parameter and generates a string of multiple inputs for an input parameter in another calculation view.</p>
  
  <pre><code>BEGIN 
  declare paramStr clob;
  params = select foo 
           from bar 
           where bar.id = :IP_ID;
  
  select '''' || string_agg(foo, ''', ''') || ''''
  into paramStr 
  from :params;
  
  var_out = select * 
            from  "_SYS_BIC"."somepackage/MULTIPLE_IP_VIEW"(PLACEHOLDER."$$IP_IDS$$" =&gt; :paramStr);
  END
  </code></pre>
  
  <p>This works as expected. However, if I change the <code>var_out</code> query and try to use the variable in a where clause</p>
  
  <pre><code>BEGIN 
  ...
  
  var_out = select * 
            from  "_SYS_BIC"."somepackage/MULTIPLE_IP_VIEW"
            where "IP_IDS" in(:paramStr);
  END
  </code></pre>
  
  <p>the view will activate, but I get no results from the query. No runtime errors, just an empty result set. When I manually pass in the values to the <code>WHERE IN()</code> clause, everything works fine. It seems like an elementary problem to have, but I can't seem to get it to work. I have even tried using <code>char(39)</code> rather than <code>''''</code> in my concatenation expression, but no banana :(</p>