nested cursors problem
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);