I have two tables in database which contain URLS(almost ONE LAKH each).
Both tables may contain same URLS or different URLS.
So i need to copy these URLS in two different files from two tables and i have to compare those URLs.
So I planned to LOAD the URLS from database to TWO different files.But i am getting "OUT OF MEMORY!" error.
So initially i tried copying only 100URLS from database to each file.
Following is the code:
use DBI;
### The database handlemy $var;
my $var_ex;
my $dbh = DBI->connect( "dbi:ODBC:MSSQL");
my $dbh4 = DBI->connect( "dbi:ODBC:MSSQL");
### The statement handle
my $sth = $dbh->prepare("select Top 100 URLName from URL ORDER BY URLID DESC");
$sth->execute();
my $sth4 = $dbh4->prepare("select Top 100 URLName from URL_EXCLUDE");
$sth4->execute();
print "\n starts";
open(URLFHW,">Url.txt");
while($var = $sth->fetchrow_array )
{
print URLFHW "$var\n" ;
}
close(URLFHW);
print "\n 1st file ";
open(URLEXFHW,">Url_ex.txt");
while($var_ex = $sth4->fetchrow_array )
{
print URLEXFHW "$var_ex\n";
}
close(URLEXFHW);
print "\n 2nd file";
OUTPUT:
D:\perl> Copy_urls.pl
starts 1st file Out of memory! 2nd fileResult:
Two files(Url.txt,Url_ex.txt) created with each 100 URLS.But perl program getting terminated at second step itself it is not executing further if i write any code after second step.I have written some script for comparing URLS after second step.but it is not executing.
Can any one help me in this..
!!!!...Thanks in ADVANCE...!!!!
In reply to Out of memory! by santhosh.yamsani
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |