title: IBM Informix How to pass string value in parameter
body: <p>Could anybody help me with creating the correct SQL query for Informix db?
  I have the function in which I'm trying to prepare an SQL query from a string as described in the Informix docs </p>
  
  <pre><code>CREATE FUNCTION somefunction( stringval VARCHAR( 32 )) RETURNING INT;
  DEFINE c_query varchar(250);
  LET c_query = 'select first 1 someid, somevalue from sometable where sname= '||stringval||' order by somevalue;
  PREPARE c_stmt
  FROM c_query;
  
  DECLARE c_cur CURSOR FOR c_stmt;
  OPEN c_cur ;
  FETCH c_cur INTO sp_id ;
  CLOSE c_cur;
  FREE c_cur;
  FREE c_stmt;
  RETURN sp_id;
  END FUNCION;
  </code></pre>
  
  <p>And when I try to test it, I invoke it as follows:</p>
  
  <pre><code>SELECT * FROM table(functionname('fo'))
  </code></pre>
  
  <p>But unfortunately I get error message with text:</p>
  
  <pre><code>Column (fo) not found in any table in the query (or SLV is undefined).
  </code></pre>
  
  <p>What am I doing wrong?</p>