Thread DBI tabelle erstellen
(8 answers)
Opened by slicer at 2011-06-30 21:48
Hast natürlich recht. So sollte man es machen:
Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 #!/usr/bin/perl use strict; use warnings; use DBI; my $dbname='xxx'; my $user='anonymous'; my $pass='???'; my $dbh = DBI->connect("dbi:Pg:dbname=$dbname", $user, $pass, {RaiseError => 1, AutoCommit => 1}) or die $DBI::errstr; my $cname='nur-ein-test'; $cname = $dbh->quote_identifier($cname); $dbh->do("CREATE TABLE test ( $cname text, datum date, id int )"); $dbh->disconnect(); |