CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: DBI: in perl dbi How To Generate CSV for 1 lakh record of my Query : Edit Log



dashang.trivedi
Novice

May 11, 2011, 2:34 AM


Views: 10137
in perl dbi How To Generate CSV for 1 lakh record of my Query

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 .....


(This post was edited by dashang.trivedi on May 11, 2011, 2:38 AM)


Edit Log:
Post edited by dashang.trivedi (Novice) on May 11, 2011, 2:38 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives