title: Oracle : passing dynamic string in query through stored procedure
body: <p>If i am executing below query, it is giving me 4 correct records. </p>
  
  <pre><code>select SUBSCRIBER_NUM, SUBSCRIBER_STATUS, P_ID
  from C_S_FORWARD_INFO
  where SUBSCRIBER_NUM IN ('0', '07', '070', '0705', '07052', '070526', '0705262', '07052620') and
        SCP_VER = 1
  </code></pre>
  
  <p>But When i execute below, it is giving me 0 records. Actually I have to dynamically pass the value in 'IN' part of the query. </p>
  
  <p>I tried below ( VAR_CALLING_NUM = 07052620): </p>
  
  <pre><code>while var1&lt;=len LOOP 
  temp1 := SUBSTR(VAR_CALLING_NUM, 1, var1); 
  temp1 := concat('''',temp1); 
  temp1 := concat(temp1,''''); 
  temp6 := temp6 || temp1 || ',' ; 
  var1:=var1+1; 
  END LOOP; 
  temp6 := SUBSTR(temp6, 1,length(temp6)-1);
  
  select SUBSCRIBER_NUM, SUBSCRIBER_STATUS, P_ID from C_S_FORWARD_INFO where SUBSCRIBER_NUM IN ( temp6 ) and SCP_VER = 1 order by length(subscriber_num) desc; 
  </code></pre>
  
  <p>Why this is givign me 0 records. Am i doing anything wrong, by passing temp6 in query like  <code>SUBSCRIBER_NUM IN ( temp6 )</code></p>