/[corp]/esi/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

Annotation of /esi/dump.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations)
Sat Mar 17 17:28:57 2001 UTC (21 years, 4 months ago) by dpavlin
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +6 -4 lines
File MIME type: text/plain
fix

1 dpavlin 1.1 #!/usr/local/bin/perl -w
2    
3     use DBI;
4    
5     my $connect = "DBI:Pg:dbname=corp";
6 dpavlin 1.2 my $sql="select date(s1.date),avg(s1.current) as zse,avg(s2.current) as ftse
7     from stocks as s1,stocks as s2 where time(s1.date) != '23:23:23' and
8     time(s2.date) != '23:23:23' and s1.date=s2.date and
9     s1.type='LSE' and s2.type='FTSE'
10     group by date(s1.date),date(s2.date)
11     ";
12 dpavlin 1.1
13     my $dbh = DBI->connect("$connect","","") || die $DBI::errstr;
14    
15     $dbh->do("set datestyle='german'") || die $dbh->errstr();
16    
17     $sth = $dbh->prepare("$sql") || die $dbh->errstr();
18     $sth->execute() || die $sth->errstr();
19    
20     print "#",join("\t",@{ $sth->{NAME} }),"\n";
21     while (@arr = $sth->fetchrow_array() ) {
22     print join("\t",@arr),"\n";
23     }

  ViewVC Help
Powered by ViewVC 1.1.26