--- dump.pl 2000/04/12 08:11:45 1.1 +++ dump.pl 2001/02/15 08:35:57 1.2 @@ -4,11 +4,16 @@ die "SQL query as argument?" if (!defined($ARGV[0])); -my $mydbh = DBI->connect("DBI:Pg:dbname=informatika","","") || die $DBI::errstr; -$mysth = $mydbh->prepare("$ARGV[0]") || die $mydbh->errstr(); -$mysth->execute() || die $mysth->errstr(); +my $connect = "DBI:Pg:dbname=informatika"; +#$connect = "DBI:dbftp:DSN=video;hostname=vradan"; +#$connect = "DBI:dbftp:DSN=db1;hostname=hbreyer2"; +#$connect = "DBI:dbftp:DSN=education;user=sa;hostname=mbabic.pliva.hr"; -print "#",join("\t",@{ $mysth->{NAME} }),"\n"; -while (@myarr = $mysth->fetchrow_array() ) { - print join("\t",@myarr),"\n"; +my $dbh = DBI->connect("$connect","","") || die $DBI::errstr; +$sth = $dbh->prepare("$ARGV[0]") || die $dbh->errstr(); +$sth->execute() || die $sth->errstr(); + +print "#",join("\t",@{ $sth->{NAME} }),"\n"; +while (@arr = $sth->fetchrow_array() ) { + print join("\t",@arr),"\n"; }