Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- open(OUTFILE, "> ./outputfile.csv");
- my($dbh,$sth);
- $dbh = DBI->connect("xxx")
- my $sqlGetEid = "
- select *
- from Table_1
- where MARKET = 'Chicago' and DATETIMELOCAL >= '22-FEB-2015' and DATETIMELOCAL < '01-MAR-2015'
- ";
- my $curSqlEid = $dbh->prepare($sqlGetEid);
- $curSqlEid->execute();
- my $counter = 0;
- my $delimiter = ',';
- my $fields = join(',', @{ $curSqlEid->{NAME_lc} });
- print "$fieldsn";
- printf OUTFILE "$fieldsn";
- while (my @row = $curSqlEid->fetchrow_array) {
- my $csv = join(',', @row)."n";
- printf OUTFILE "$csv";
- $counter ++;
- if($counter % 10000 == 0){
- print $csv, "n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement