title: using comma separated values inside IN clause for NUMBER column
body: <p>I have 2 procedures inside a package. I am calling one procedure to get a comma separated list of user ids. </p>
  
  <p>I am storing the result in a <code>VARCHAR</code> variable. Now when I am using this comma separated list to put inside an <code>IN</code> clause in it is throwing "<code>ORA-01722:INVALID NUMBER"</code> exception.</p>
  
  <p>This is how my variable looks like</p>
  
  <pre><code>l_userIds VARCHAR2(4000) := null;
  </code></pre>
  
  <p>This is where i am assigning the value</p>
  
  <pre><code>l_userIds := getUserIds(deptId);  -- this returns a comma separated list
  </code></pre>
  
  <p>And my second query is like - </p>
  
  <pre><code>select * from users_Table where user_id in (l_userIds);
  </code></pre>
  
  <p>If I run this query I get <code>INVALID NUMBER</code> error.</p>
  
  <p>Can someone help here.</p>