in reply to Re: Updating Specific Fields in MS Access
in thread Updating Specific Fields in MS Access
When run, the output is:#! c:\perl\bin\perl.exe -w # # InsertDrivers.pl #Importations and Declarations use Win32::ODBC; use DBI; use strict; my ( $dbh, $sth, $vals, $driver, $servlist); my $DSN='Database'; my $field1='server'; my $field2='nic1_drv_version'; #Connect to database $dbh=DBI->connect("dbi:ODBC:$DSN", "admin", "") or die "$DBI::errstr\n +"; #Open file for reading open(INPUT,"file.txt") || die; while (<INPUT>) { #use comma delimiter ($servlist, $driver)=split(/,/); #statement, prepare, execute, close handle my $sqlstatement=("UPDATE Servers SET nic1_driver_version=$driver +WHERE '$field1 eq $servlist\n'"); $sth=$dbh->prepare($sqlstatement); $sth->execute || die; $sth->finish; } close (INPUT); $dbh->disconnect;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Updating Specific Fields in MS Access
by Enlil (Parson) on Apr 17, 2003 at 21:59 UTC | |
by p0lp0t (Initiate) on Apr 17, 2003 at 23:36 UTC | |
by pfaut (Priest) on Apr 18, 2003 at 00:24 UTC | |
by p0lp0t (Initiate) on Apr 18, 2003 at 00:38 UTC |