title: How to use parameters in a 'where value in...' clause?
body: <p>This works when I have only one state code  as a parameter.</p>
  
  <p>How can I get code to work when I have more than one state_code in parm_list? </p>
  
  <p>Requirements:</p>
  
  <p>(1)I don't want to hard code the state codes in my cursor definition </p>
  
  <p>(2) I do want to allow for more than one state code in my where clause</p>
  
  <p>For example: I want to run this code for <strong>parm_list = ('NY','NJ','NC')</strong>.
  I'm encountering difficulties in reconciling single quotes in parm_list with the single quotes in the 'where state_code in ' query.</p>
  
  <pre><code>set serveroutput on;
  
  DECLARE
  parm_list varchar2(40);
  
  cursor get_state_codes(in_state_codes varchar2)
  is
  select state_name, state_code from states
  where state_code in (in_state_codes);
  
  BEGIN
   parm_list := 'NY';
   for get_record in get_state_codes(parm_list) loop
    dbms_output.put_line(get_record.state_name || get_record.state_code);
   end loop;
  END;
  </code></pre>