Hallohier erstmal der Code :
#!/usr/bin/perluse DBI;
$url="abfrage-database2.pl";
open(DATEI,">../temp/ausgabe.txt");
%properties = ( 'user' => 'xxxxxx',
'password' => 'xxxxxxxx',
'host.name' => 'xxx.xxx.xxx.xxx',
'host.port' => 'xxx' );
$dsn = "dbi:JDBC:hostname=localhost:9001;url=jdbc:db2://192.168.6.78:446/APDB2ZSB";
$dbh = DBI->connect($dsn, undef, undef,
{PrintError => 0,RaiseError => 1, jdbc_properties => \%properties})
or die "Failed to connect: ($DBI::err) $DBI::errstr\n";
$sth = $dbh->prepare("select ip_pool_unit from tabelle1 where domain_index=1");
$sth->execute();
print DATEI while ((@row) = $sth->fetchrow_array)
{
print DATEI join ("\t\t", map {defined $_ ? $_ : "(null)"} @row),"\n";
}
$dbh->disconnect();
close(DATEI);
print "location: $url\n\n";
Bei einem kurzem SQL-Statement funktioniert das Ganze einwandfrei und das Ergebnis wird mithilfe eines HTML Template einer Textbox in einer HTML-Seite ausgegeben.So mein Problem ist jetzt, dass mein SQL-Statement aber um einiges länger ist da es über 5 Tabellen geht. Wie mache ich es jetzt, dass er das auch macht? Als Fehlercode kommt MYSQL-Error 102.
Tschau
Datum: 27.06.2006-09:26
