>I just checked everything with a co-worker who maintains this web-app longer
>than i do :).
>
>The downgrad from apache-1.3.22-2 to apache-1.3.20-16 hasn't helped!
>
>Now I will update my kernel to 2.4.18. (no rpm....compile by myself :)
>
The kernel update was unnecessary cause it brought no speed increase.
Now my co-worker and I changed the epl. It seems that the large amount of while
loops (2100 x 16 = 33.600) is a problem in Embperl 2.0b7. The same epl runs a
lot faster in Embperl 1.3.1 and 1.3.4 (I upgraded the "old" machine).
Now both machines run on Embperl 2.0b7 because the "local $" = '</td><td>';"
didn't work on Embperl 1.3.x (only when local $" = '\</td>\<td>';...but we want
to have only one version on both machines....so 1.3.1->2.0b7 one the "old" one).
Here is the current version of the script:
(See attached file: view-table.epl)
THX for the great help! Alex
Title: SQL table lister
[-
use nactools;
eval
{
local $SIG{'__DIE__'};
$maxcol = 100;
$maxrow = 10000;
$sort = $fdat{"sort"};
$table = $fdat{"table"};
$sqlcmd = "SELECT * FROM $table ";
if($sort)
{
$sqlcmd .= "ORDER BY $sort ";
}
$dbh = connectdb();
# get column names
$sth = $dbh->prepare($sqlcmd);
@colnames = @{$sth->{NAME_uc}};
foreach $index ( 0 .. $#colnames)
{
$colnames[$index] =~ s/ *$//;
if (uc($colnames[$index]) eq uc($fdat{"pkey"}))
{
$pkeycol = $index;
}
}
# get table
@lines = @{$dbh->selectall_arrayref($sth)};
};
perish($@) if $@;
-]
Table [+ $table +] returned [+ $#lines+1 +] rows
[$ foreach $colname (@colnames) $]
[+ $colname +] |
[$ endforeach $]
[$ if ($fdat{"pkey"} ne "") $]
|
[$ endif $]
[$ foreach $record (@lines) $]
[-
$escmode = 0; # embperl: don't touch my output!
@l = @$record;
local $" = ''; # define separator for interpolated list elements
$out = "@l"; # out <== current record set, separated by $"
$class = ( $class eq 'light' ) ? 'dark' : 'light';
-]
|
[+ $out +] |
[$ endforeach $]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]