Thread DBI tabelle erstellen (8 answers)
Opened by slicer at 2011-06-30 21:48

topeg
 2011-07-01 00:53
#150062 #150062
User since
2006-07-10
2611 Artikel
BenutzerIn

user image
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();

View full thread DBI tabelle erstellen