/[informatika.old]/dump.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /dump.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by dpavlin, Wed Apr 12 08:11:45 2000 UTC revision 1.2 by dpavlin, Thu Feb 15 08:35:57 2001 UTC
# Line 4  use DBI; Line 4  use DBI;
4    
5  die "SQL query as argument?" if (!defined($ARGV[0]));  die "SQL query as argument?" if (!defined($ARGV[0]));
6    
7  my $mydbh = DBI->connect("DBI:Pg:dbname=informatika","","") || die $DBI::errstr;  my $connect = "DBI:Pg:dbname=informatika";
8  $mysth = $mydbh->prepare("$ARGV[0]") || die $mydbh->errstr();  #$connect = "DBI:dbftp:DSN=video;hostname=vradan";
9  $mysth->execute() || die $mysth->errstr();  #$connect = "DBI:dbftp:DSN=db1;hostname=hbreyer2";
10    #$connect = "DBI:dbftp:DSN=education;user=sa;hostname=mbabic.pliva.hr";
11    
12  print "#",join("\t",@{ $mysth->{NAME} }),"\n";  my $dbh = DBI->connect("$connect","","") || die $DBI::errstr;
13  while (@myarr = $mysth->fetchrow_array() ) {  $sth = $dbh->prepare("$ARGV[0]") || die $dbh->errstr();
14          print join("\t",@myarr),"\n";  $sth->execute() || die $sth->errstr();
15    
16    print "#",join("\t",@{ $sth->{NAME} }),"\n";
17    while (@arr = $sth->fetchrow_array() ) {
18            print join("\t",@arr),"\n";
19  }  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.26