Hello EveryOne,

My Objective is to generate CSV file of my query output.
if my table have 1 Lakh record...
i am using this way
Code:
open(CSV, "> file.csv"); 
$sth = $dbh->prepare('SELECT * FROM exmpl_tbl '); 
$sth->execute(); 
while($result = $sth->fetchrow_hashref()) { 
  print CSV  "$result->{id} , $result->{val} \n"; 
} 
 
close(CSV);
This way is not optimize way to generate CSV...
how to generate CSV for 1 lakh record or more in fast way....

so please suggest me .....