#!/usr/bin/perl use DBI; $dsn = 'DBI:Sybase:host=hostNameInFreeTDSconf;database=gewuenschteDB'; my $dbh = DBI->connect($dsn, "username", 'password'); die "unable to connect to server $DBI::errstr" unless $dbh; $dbh->do("use gewuenschteDB"); $query = "SELECT * FROM Session"; $sth = $dbh->prepare ($query) or die "prepare failed\n"; $sth->execute( ) or die "unable to execute query $query error $DBI::errstr"; $rows = $sth->rows ; print "$row rows returned by query\n"; while ( @first = $sth->fetchrow_array ) { foreach $field (@first) { print "field: $field\n"; } }