Thread Datenbankabfrage durchläuft while nicht vollständig (2 answers)
Opened by Stefan_S at 2016-02-26 12:54

Stefan_S
 2016-02-26 13:25
#183990 #183990
User since
2014-04-15
30 Artikel
BenutzerIn
[default_avatar]
Bingo, genau das war's.

So funktioniert's jetzt:

Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
my ( $artikelnr_s, $bestand_s );
my ( $id_t, $artikelnr_t, $timestamp_t, $bestand_t );
print "====================================================================\n";
while ( ( $artikelnr_s, $bestand_s ) = $dbs_result->fetchrow_array() ) {
        # alle Datensätze aus Ziel lesen
        $statement_t1 = "SELECT id, artikel_nr, timestamp, bestand FROM bestaende";
        &dbt1_execute;
        print Dumper ( "DB1: \t " . $artikelnr_s . "\t" . $bestand_s );
        print "\n";
        while ( ( $id_t, $artikelnr_t, $timestamp_t, $bestand_t ) = $dbt1_result->fetchrow_array() ) {
                print Dumper ( "DB2: \t " . $artikelnr_t . "\t" . $bestand_t );
        }
        print "--------------------------------------------------------------------\n";
}
        print "\n\n\n";


und

Code (perl): (dl )
1
2
3
4
5
# Datenbankabfrage DB2 ausführen
sub dbt1_execute {
        $dbt1_result = $dbt->prepare ( qq {$statement_t1} );
        $dbt1_result->execute() or die DBI->errstr;
        }


Danke und Gruß Stefan

View full thread Datenbankabfrage durchläuft while nicht vollständig