This shows you the differences between two versions of the page.
kurs:dbd--postgres [2011/02/13 21:50] mh |
kurs:dbd--postgres [2014/09/10 21:22] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | <code> | ||
- | gisdb=# create user gisdb with password 'gisdb'; | ||
- | CREATE ROLE | ||
- | </code> | ||
- | <code> | ||
- | use strict; | ||
- | use warnings; | ||
- | |||
- | use DBI; | ||
- | |||
- | my $dbh = DBI->connect("dbi:Pg:dbname=dumpdb", 'mh', 'mh', {AutoCommit => 0}); | ||
- | |||
- | my $sth = $dbh->prepare('select * from bla'); | ||
- | |||
- | $sth->execute(); | ||
- | |||
- | while (my @r = $sth->fetchrow) { | ||
- | print "@r\n"; | ||
- | } | ||
- | |||
- | $sth->finish; | ||
- | $dbh->disconnect; | ||
- | </code> |