Hello All,
i am trying to select a big chunk of data to archive it into a flat file.
Its a " select * " query which normally returns 1,200,000 records.
1. Is there anything in DBI/DBD that I can use to do the job without
selecting first and then storing it?
2. which method in DBI/DBD should I try for a faster use. This is what i
currently do (which doesnt seem to be working very fast. It just sits
there.)
$sql = "SELECT * FROM FT_T_ISST WHERE
END_TMS IS NOT NULL
AND LAST_CHG_USR_ID <>'BOXV2'
ORDER BY INSTR_ID";
$array_ref = $dbh->selectall_arrayref($sql);
open (OUTFILE, ">$tfm") or die ("Cannot open $tfm.");
foreach my $record(@$array_ref){
print OUTFILE join("|",@$record)."\n";
}
close OUTFILE;
Well this is a first thing that came to my mind to do. Is is the right way
to do it?
Thanx a lot.
PS: maybe my data structure cant handle that many records at a time and I
should use something like: where rownum<=500,000 ???
_____________________________________________________________________
IMPORTANT NOTICES:
This message is intended only for the addressee. Please notify the
sender by e-mail if you are not the intended recipient. If you are not the
intended recipient, you may not copy, disclose, or distribute this message
or its contents to any other person and any such actions may be unlawful.
Banc of America Securities LLC("BAS") does not accept time
sensitive, action-oriented messages or transaction orders, including orders
to purchase or sell securities, via e-mail.
BAS reserves the right to monitor and review the content of all
messages sent to or from this e-mail address. Messages sent to or from this
e-mail address may be stored on the BAS e-mail system.