mahicool has asked for the wisdom of the Perl Monks concerning the following question:
#!usr/bin/perl -w use DBI; use strict; my $data_source = "xxxxx"; my $user = "track"; my $password = "none"; #conect #my $dup; my $dbh = DBI->connect ($data_source, $user, $password) or die "Can't connect to $data_source: $DBI::errstr"; my $sth = $dbh->prepare("select MFR_CODE from ED_PART_TRACKING where PART_NUMBER=?") or die "can't prepare statement: $DBI::errs +tr"; open( FILE, "<", "mahi.txt") or die "Unable to open $.t file"; while(<FILE>) { my $kk = $_; chomp($kk); print "$kk\n"; $sth ->execute($kk) or die "Couldn't execute statement: " . $sth->errs +tr; my ($dup) = $sth->fetchrow_array(); print "$dup"; if($dup eq $kk) { print"persent"; } } exit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: error in sql query while using DBI
by pc88mxer (Vicar) on Jul 16, 2008 at 16:33 UTC | |
|
Re: error in sql query while using DBI
by moritz (Cardinal) on Jul 16, 2008 at 16:31 UTC | |
|
Re: error in sql query while using DBI
by runrig (Abbot) on Jul 16, 2008 at 17:45 UTC | |
|
Re: error in sql query while using DBI
by LesleyB (Friar) on Jul 16, 2008 at 17:18 UTC |