title: how to pass a table name as parameter to stored procedure?
body: <p>Is it possible to create a <code>rowtype</code> for a table name which is passed as a parameter to a <code>Stored-Procedure</code> and also how do i know the columns to address them in the <code>DBMS_OUUTPUT.PUT_LINE()</code> statement.</p>
  
  <p>The end user can give any user name(schema) and table name </p>
  
  <p>I want to do something as below but it does not work.</p>
  
  <pre><code> CREATE OR REPLACE PROCEDURE SP_PASS(USER_NAME VARCHAR2,TAB_NAME IN VARCHAR2)
   AS
      TYPE REF_CUR IS REF CURSOR;
      V_ARR REF_CUR;
      V_SQL VARCHAR(200);
      V_ROWTYPE USER_NAME.TAB_NAME%ROWTYPE;
   BEGIN
       V_SQL := 'SELECT * FROM '||USER_NAME||'.'||TAB_NAME;
       OPEN V_ARR FOR V_SQL;
       LOOP
       FETCH V_ARR INTO V_ROWTYPE;
       EXIT WHEN V_ARR%NOT FOUND;
       DBMS_OUTPUT.PUT_LINE(V_ROWTYPE.COL1||','||V_ROWTYPE.COL2||','||V_ROWTYPE.COL3);
       END LOOP;
       CLOSE V_ARR;
  END;
  </code></pre>
  
  <p>Let me know if it is possible .</p>
  
  <p>Thanks.</p>