You originally asked for:
Originally posted by parijat67
the right approach to solve this problem
The right approach is not to generate INSERT statements.

Another better option also would be to create a comma/tab/or pipe delimited file and use sql loader.