title: How to pass a python array to an oracle stored procedure?
body: <p>I have a problem. When I pass a Python array:</p>
  
  <pre><code>self.notPermited = [2,3]
  </code></pre>
  
  <p>This is my procedure</p>
  
  <pre><code>def select_ids_entre_amistades(self,cod_us,ids_not):
      lista = []
      try:
          cursor = self.__cursor.var(cx_Oracle.CURSOR)
          print ids_not
          data = self.__cursor.arrayvar(cx_Oracle.NUMBER, ids_not)
          print data
          l_query = self.__cursor.callproc("SCHEMA.PROC_SELECT_IDS_ENT_AMISTADES", [cursor,cod_us,data])
          lista = l_query[0]
          return lista
      except cx_Oracle.DatabaseError as ex:
          error, = ex.args
          print(error.message)
          return lista
  </code></pre>
  
  <p>The problem is when I call that procedure using this:</p>
  
  <pre><code>self.select_ids_entre_amistades(int_id,self.notPermited)
  </code></pre>
  
  <p>I visualize in the console the following message:</p>
  
  <blockquote>
    <p>PLS-00306: wrong number or types of arguments in call to 'PROC</p>
  </blockquote>
  
  <p>In the database I create the array object like this:</p>
  
  <pre><code>CREATE TYPE SCHEMA.ARRAY_ID_FRIENDS AS TABLE OF INT;
  </code></pre>
  
  <p>The Oracle stored procedure starts like this:</p>
  
  <pre><code>CREATE OR REPLACE PROCEDURE FACEBOOK.PROC_SELECT_IDS_ENT_AMISTADES
  (CONSULTA OUT SYS_REFCURSOR,COD_US IN INT, IDS_FRIEND IN SCHEMA.ARRAY_ID_FRIENDS)
  </code></pre>
  
  <p>I don't know what the problem is, I believe <code>cx_Oracle.NUMBER</code> is not integer but there aren't other numeric type. Thanks in advance.</p>