title: Pass comma separated number to IN clause in Stored Procedure
body: <p>I have a stored procedure which takes a varchar parameter called  P_LOCATIONS in Oracle. This locations parameter has location id's that are comma separated. In database locationId is a number.</p>
  
  <p>Following sql query throws an Invalid number when there are more than one locations. I understand that because of comma its not able to convert a varchar into a number. How can I achieve this?</p>
  
  <pre><code>    create or replace PROCEDURE       GET_RAW_DATA
        (   P_LOCATIONS IN VARCHAR2, 
            Results   OUT   SYS_REFCURSOR
          )AS 
          BEGIN
  
         select * from tableName where LOCATION_ID IN ( P_LOCATIONS);
        END GET_RAW_DATA;
  </code></pre>