Leser: 1
7 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$dbh2 = DBI->connect($DB_DSN);
$dbh3 = DBI->connect($DB_DSN);
$dbh4 = DBI->connect($DB_DSN);
&open_sql("SELECT Feld32,ID FROM READY2 WHERE bearbeitet is NULL",$DB_DSN); #Start MSSQL
while ( $result = $sth->fetchrow_hashref() )
{
$x++;
$ID=$result->{'ID'};
print "$ID\n";
$sth3 = $dbh3->prepare("UPDATE READY2 SET bearbeitet=1 WHERE ID=$ID");
$sth3->execute; $sth3->finish();
print "erledigt";
exit;
}
&close_sql; #END MSSQL
$dbh2->disconnect();
$dbh3->disconnect();
$dbh4->disconnect();
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
my $dbh = DBI->connect($DB_DSN);
&open_sql("SELECT Feld32,ID FROM READY2 WHERE bearbeitet is NULL",$DB_DSN); #Start MSSQL
while ( $result = $sth->fetchrow_hashref() )
{
my $ID=$result->{'ID'};
print "$ID\n";
my $sth3 = $dbh->prepare("UPDATE READY2 SET bearbeitet=1 WHERE ID=?") or die $dbh->errstr();
$sth3->execute($ID) or die $dbh->errstr();
$sth3->finish();
print "erledigt";
exit;
}
&close_sql; #END MSSQL
$dbh->disconnect();
1
2
3
4
5
6
7
8
9
10
sub open_sql
#SQL öffnen
{
$dbh = DBI->connect($_[1]);
$sth = $dbh->prepare($_[0]);
$sth->execute;
}
sub close_sql { $sth->finish(); $dbh->disconnect();} #SQL schliessen....
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use DBI;
use DBD::ODBC;
use strict;
my $dbh = DBI->connect('dbi:ODBC:driver={SQL Server}; server={192.168.0.118}; database=TWIXGAMS');
my $sth = $dbh->prepare("SELECT Feld32,ID FROM READY2 WHERE bearbeitet is NULL");
$sth->execute;
while (my $result = $sth->fetchrow_hashref() )
{
print "$result->{'ID'}\n";
my $sth3 = $dbh->prepare("UPDATE READY2 SET bearbeitet=1 WHERE ID=?") or die $dbh->errstr();
$sth3->execute($result->{'ID'}) or die $dbh->errstr();
$sth3->finish();
print "erledigt"; exit;
}
$sth->finish();$dbh->disconnect();
7 Einträge, 1 Seite |