nested cursors problem I'm trying to restore all the inserts that I've done in my tables. 
I have a cursor that loops through table names, a second one that loops through all the rows from that table and a third one that loops through all the columns.
The problem is that I can't declare a dynamic row because it gives an exception at runtime. Is there any solution to my problem? Or can you suggest another approach?

Here is the code:

declare
  cursor c_table is select table_name from user_tables;
  sql_query varchar2(100);
  rc sys_refcursor;
begin
  for v in c_table loop
    dbms_output.put_line('INSERT INTO ' || v.table_name ||' VALUES (');

      sql_query := 'select * from '||v.table_name;
      open rc for sql_query;    
      loop
        ---- here i want to fethc all the rows 
        declare
          sql_statement varchar2(200);
          v_column varchar2(50);
          re sys_refcursor;
        begin
          sql_statement := 'select column_name from user_tab_columns where table_name = '|| q'[']' || v.table_name || q'[']';
          open re for sql_statement;
          loop
            fetch rc into v_column;
            exit when rc%notfound;
          end loop;
          close re;
        end;
      end loop;
  end loop;
end;
I would not bother implementing it, because others already did it and spent a lot of time with it. SQL Developer can do this for you.

Example: Exporting Metadata and Data for a Table

In SQL Developer, click Tools, then Database Export.

Set the required options:



Select object types, after that, select the tables you want to be exported:



Result will be something like this when choosing to export data only:

--------------------------------------------------------
--  File created - Wednesday-May-10-2017   
--------------------------------------------------------
REM INSERTING into BP.T1
SET DEFINE OFF;
Insert into BP.T1 (C1) values (1);
REM INSERTING into BP.T2
SET DEFINE OFF;
Insert into BP.T2 (C1) values (2);