HI,

I am running the Perl DBI interface which connects to a Oracle 8.1.7
database.  This all works fine.  The problem that I have is that when I
run a particular script ( show below) the dataset that is returned
includes rows from the database that I had deleted prior to running the
script?  Any thoughts.  Thanks,

#!/usr/local/bin/perl -w
#Modification for the ICCS database

        require "/egain/apache/cgi-bin/cgi-lib.pl";
#Use Perl's Database Interface (DBI) with the Oracle module to connect
the database
        use DBI;
        
        my $workgroup;
        my $ROWID;
        my $reported_by;
        my $description;

        $ENV{ORACLE_HOME}='/egain/oracle';      
        $ENV{ORACLE_SID}='TSOICCS';
        my $dbname='TSOICCS';
        my $dbuser='trevor';
        my $dbpass='hp976cxi';
        my
$dbh=DBI->connect('dbi:Oracle:host=kbs.sd.avaya.com;sid=TSOICCS;port=1523',"$dbuser/$dbpass")||
 die     "Unable to connect to TSOICCS database on kbs.sd.avaya.com: $DBI::errstr\n";
# Using the cgi-lib.pl script, we will read in the variables from the
form.
        
#Prepare the SQL statment to be executed and use Oracle SYSDATE
# function to generate the date

my $sth=$dbh->prepare("SELECT ROWID,workgroup,reported_by,description
from trouble_report WHERE completed_date LIKE '%01-JAN-00%'");
#$sth=$dbh->prepare("SELECT ROWID,workgroup,reported_by,description from
trouble_report");
# Execute the SQL statement

$sth->execute();

#Bind the column variables

$sth->bind_columns(\$ROWID,\$workgroup,\$reported_by,\$description);

print "Content-type: text/html\n\n";

print "<HTML>";
print "<HEAD>";
print "<TITLE></TITLE>";
print "</HEAD>";
print "<BODY>";
print "<Form Method=\"Post\" Action=\"get_open_tickets.cgi\">\n";
print "<TABLE Border=3 width=100%>\n";
print "<TR><TH>ID<TH>Workgroup<TH>Reported By<TH>Description\n";

while ( $sth->fetch) {
                        print "<TR><TD><input type=\"submit\"
Name=\"Edit\" Value=\"$ROWID\">
<TD>$workgroup <TD>$reported_by <TD>$description";
        }               
        $sth->finish();
                                }
print "</TABLE>";                                       
print "</Form>";
print "</BODY>";
print "</HTML>";

# Disconnnect from the database
$dbh->disconnect;

# We call the done subroutine to close out the window that called the
cgi script using the submit button.
#       done();
                sub done { 
                        print "<SCRIPT language=\"JavaScript\">
window.close(); </SCRIPT>";
                        }
exit(0);



-- 
Trevor Morrison <[EMAIL PROTECTED]>


Reply via email to