title: How to pass a value from c# to refcursor parameter in oracle stored procedure
body: <p>Can you help me to pass a value from C# to refCursor type. I tried to send dataTable as shown in below link, but its not working.
  <a href="https://stackoverflow.com/questions/27249670/pass-datatable-to-refcursor-of-oracle-stored-procedure">Pass datatable to refcursor of Oracle stored procedure</a></p>
  
  <p>Stored procedure: </p>
  
  <pre><code>PROCEDURE PROC_INS(  P_USERID IN VARCHAR2,
                       P_ATTACH_LIST IN SYS_REFCURSOR,
                       P_out      OUT NUMBER,
                       P_msg     OUT VARCHAR2) AS
  
  V_BRS_USERID         VARCHAR2(50);
  V_ATTACHMENT_TYPE_ID BRS_USER_ATTACHMENT.ATTACHMENT_TYPE_ID%TYPE;
  V_FILE_NAME          BRS_USER_ATTACHMENT.FILE_NAME%TYPE;
  V_FILE_SIZE          BRS_USER_ATTACHMENT.FILE_SIZE%TYPE;
  V_FILE_DESCR         BRS_USER_ATTACHMENT.FILE_DESCR%TYPE; 
  
  BEGIN 
  LOOP 
  FETCH P_ATTACH_LIST INTO V_BRS_USERID, V_ATTACHMENT_TYPE_ID,V_FILE_NAME, V_FILE_SIZE,   V_FILE_DESCR; 
  EXIT WHEN P_ATTACH_LIST%NOTFOUND; 
  INSERT INTO USER_ATTACHMENT VALUES
          (SEQ_RER_EMP_REP_ID.NEXTVAL,
            V_BRS_USERID,
            V_ATTACHMENT_TYPE_ID,
            V_FILE_NAME,
            V_FILE_SIZE,
            V_FILE_DESCR,
            NULL,
            NULL,
            0,
            0,
            'A',
            P_USERID,
            SYSDATE,
            NULL,
            NULL
          );
  
  END LOOP; 
  
  CLOSE P_ATTACH_LIST;
  EXCEPTION
   WHEN OTHERS THEN
   ROLLBACK; -- Transaction mgmt
   p_out := 2;
   p_msg := sqlerrm;
  
    END PROC_REG_INS_ATTACH;  
  </code></pre>