I'm sorry... here  it is
=================
#!c:/activeperl/bin/perl
use strict;
use warnings;
use DBI;
use DBD::Oracle;
use CGI qw(:standard *table *Tr );
use CGI::Carp qw(fatalsToBrowser);
my $dbh = DBI->connect('DBI:Oracle:sid', 'uid', 'pw') || die "Couldn't connect to    
database: " . DBI->errstr;
my %head = ( -bgcolor => "#eeeeee",  -align   => "left", );
my %bgca = ( -bgcolor => "#ffffff",  -align   => "right", );
my @cols = param('select');
my $sql = "
SELECT coban.c_oac_oban ,c_fund_code, 
        DECODE(d_doc_nbr, null, ' '  , d_doc_nbr), 
        TO_CHAR(ie_dollar_amt, '\$999,999.99'),
        DECODE(d_cost_cd, null, ' ' , d_cost_cd)
        FROM 
        cpas_difms cd,
        (SELECT c_oac_oban, ie_infile, ie_seq_nbr FROM table1
        WHERE (ie_infile, ie_seq_nbr) IN
        (SELECT ie_infile, ie_seq_nbr FROM table1
        WHERE ie_proc_cd='1')) coban
        WHERE  ie_proc_cd='1' 
        AND coban.ie_infile = cd.ie_infile and coban.ie_seq_nbr = cd.ie_seq_nbr 
        UNION ALL
        SELECT goban.g_oac ||  goban.g_asn_oban OAC_OBAN,  g_fund_code, 
        DECODE(d_doc_nbr, null, ' ', d_doc_nbr),        
        TO_CHAR(ie_dollar_amt, '\$999,999.99'),
        DECODE(d_cost_cd, null, ' '  , d_cost_cd)
        FROM 
        gafs_difms gd,
        (SELECT g_oac, g_asn_oban,ie_infile, ie_seq_nbr FROM table2
        WHERE (ie_infile, ie_seq_nbr) IN
        (SELECT ie_infile, ie_seq_nbr FROM table1
        WHERE ie_proc_cd='1')) goban
        WHERE ie_proc_cd='1' 
        AND goban.ie_infile = gd.ie_infile and goban.ie_seq_nbr = gd.ie_seq_nbr";
my $sth;
$sth = $dbh->prepare($sql);
my $rv;
$rv = $sth->execute;
my (@row_ary, $ar);
$ar = $sth->fetchall_arrayref;

print header( -type =>"text/html" ), 
        start_html( -title   => "...",  -bgcolor => "#FEF3DE", -font face => "tahoma", 
-font size => "1",),
        b("... Unmatched Transactions Report"),br,
start_table(
        { -border =>  1,
          -cellspacing => 0,
          -width  => 600,
        } ),
        th( \%head );
        print start_Tr(),
        td(\%head,
                b(" OAC        Fund"),
                br,
                b(" OBAN        
    Code           Document
 Number   
                   Amount                        Cost
 Code"),
        ),                      
        end_Tr;
        print end_table,
        start_table(
                { -border =>  0,
                  -cellspacing => 2,
                  -width  => 600,
                } ),
        th( \%bgca, [EMAIL PROTECTED] );
        foreach (@$ar) {
        print start_Tr(),
                td( \%bgca,
                $_ 
                ),                      
        end_Tr;
         $NUM_OF_ROWS++;
        }
        print end_table;
       print end_html;
       print ("<p><font size='2'><b>","Query returned  $NUM_OF_ROWS records" , 
"</font></b></p>");
=====================

-----Original Message-----
From: Wiggins d Anconia [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 03, 2004 3:21 PM
To: MCMULLIN, NANCY; Perl Beginners
Subject: Re: running slow...


> Can anyone tell me what is slowing down my script below?   The SQL
statement by itself executes in less than a second (outside of this Perl
program), but this script takes about 10 seconds to come up..
> 
> Note: I'm just learning, so I'm sure there's a lot that could be
improved...
> 

Gonna need the code.... ??

http://danconia.org


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to