/[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

Contents of /dump.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations)
Thu Feb 15 08:35:57 2001 UTC (23 years, 1 month ago) by dpavlin
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +11 -6 lines
File MIME type: text/plain
nova imena varijabli

1 #!/usr/local/bin/perl -w
2
3 use DBI;
4
5 die "SQL query as argument?" if (!defined($ARGV[0]));
6
7 my $connect = "DBI:Pg:dbname=informatika";
8 #$connect = "DBI:dbftp:DSN=video;hostname=vradan";
9 #$connect = "DBI:dbftp:DSN=db1;hostname=hbreyer2";
10 #$connect = "DBI:dbftp:DSN=education;user=sa;hostname=mbabic.pliva.hr";
11
12 my $dbh = DBI->connect("$connect","","") || die $DBI::errstr;
13 $sth = $dbh->prepare("$ARGV[0]") || die $dbh->errstr();
14 $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 }

  ViewVC Help
Powered by ViewVC 1.1.26