in reply to Re: SQL error
in thread SQL error
Here is the exact code but I am still receiveing the same error.#Windows-based Perl/DBI/MS Access example use DBI; #open connection to Access database $dbh = DBI->connect( "dbi:ODBC:driver=Microsoft Access Driver (*.mdb); +dbq=C:TestCasesXP2K.mdb", "", "" ); #prepare and execute SQL statement $stg = $dbh->prepare('SELECT REFERENCE, REQUIREMENT FROM TestCasesOutp +ut WHERE PassFail = "FAIL"'); print "are we getting here"; $stg->execute || die "Could not execute SQL statement ... maybe invalid?"; $sth = $dbh->prepare('SELECT REFERENCE FROM TestCasesOutput'); $sth->execute || die "Could not execute SQL statement ... maybe invalid?"; #output database results $stt = $dbh->prepare('SELECT REQUIREMENT FROM TestCasesOutput'); $stt->execute || die "Could not execute SQL statement ... maybe invalid?"; #output database results while (@row=$stg->fetchrow_array) { @row1=$sth->fetchrow_array; @row2=$stt->fetchrow_array; open(fileOUT, ">>log.txt") or dienice("Can't open log.txt for writ +ing: $!"); flock(fileOUT, 2); seek(fileOUT, 0, 2); print fileOUT "Reference: @row1\n"; print fileOUT "Requirement: @row2\n\n\n\n"; } close(fileOUT);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: SQL error
by Jenda (Abbot) on Aug 13, 2004 at 13:47 UTC | |
|
Re^3: SQL error
by Anonymous Monk on Aug 13, 2004 at 13:48 UTC | |
by bassplayer (Monsignor) on Aug 13, 2004 at 15:07 UTC | |
by Anonymous Monk on Aug 13, 2004 at 13:53 UTC | |
by Jenda (Abbot) on Aug 13, 2004 at 14:28 UTC | |
by TrekNoid (Pilgrim) on Aug 13, 2004 at 15:17 UTC |