title: Oracle PL/SQL issue: PLS-00306 : wrong number or types of arguments in call to
body: <p>Today I have code I get error</p>
  <blockquote>
  <p>PLS-00306: wrong number or types of arguments in call to</p>
  </blockquote>
  <p>and I make sure the code working fine but when I use in dynamic code not worked</p>
  <pre><code>CREATE OR REPLACE PROCEDURE TB_DATA(P_TB_NAME VARCHAR2)
  IS
   V_COLUMNS VARCHAR2(32000) := GET_ALL_COLUMNS(P_TB_NAME) ;
   V_COLUMNS_IN_LOOP VARCHAR2(32000) :=  'I.'||REPLACE ( GET_ALL_COLUMNS(P_TB_NAME) , ',' , '||'',''||I.') ;
   V_FILE UTL_FILE.FILE_TYPE ;
  BEGIN
  
    EXECUTE IMMEDIATE 'DECLARE
    CURSOR C1 IS 
              SELECT '||V_COLUMNS || ' 
              FROM '||P_TB_NAME || ';
                 
  BEGIN 
  ' ||V_FILE ||' := UTL_FILE.FOPEN ( ''MY_DIR'' , ''TASK9.CSV'' ,   ''W'' ) ;
      UTL_FILE.PUT_LINE ( '||V_FILE ||' , '|| V_COLUMNS||');
       FOR I IN C1 LOOP 
       UTL_FILE.PUT_LINE ( '||V_FILE ||', '|| V_COLUMNS_IN_LOOP||') ;
       END LOOP ; 
  END ;';
  
  END ;
  </code></pre>
  <p>Function:</p>
  <pre><code>CREATE OR REPLACE FUNCTION HR.GET_ALL_COLUMNS (P_TABLE VARCHAR2)
  RETURN VARCHAR2
  IS
    CURSOR C IS 
              SELECT *
              FROM USER_TAB_COLUMNS
              WHERE TABLE_NAME = P_TABLE ;
    CURSOR C1 IS           
              SELECT *
              FROM TAB 
              WHERE TNAME = P_TABLE ;
              
              
  
  V_COLS VARCHAR2(32000); 
  V_COLS2 VARCHAR2(32000);       
  BEGIN
    FOR I IN C LOOP 
  V_COLS :=  V_COLS ||','|| I.COLUMN_NAME  ;
    END LOOP ;
     FOR V IN C1 LOOP 
     V_COLS2  := V_COLS2 ||','|| P_TABLE ;
     END LOOP ;
    
   
    RETURN LTRIM( V_COLS , ',') ;
  
  END ;
  </code></pre>
  <p>I just need to know where is my mistake or what is missing.</p>