artist has asked for the wisdom of the Perl Monks concerning the following question:
Template Code:
Working Code:[% USE d = DBI(database = "dbi:AnyData", user = "", password = ""); d.dbh.func("t_labels", "CSV", "/tmp/demo_labels.csv", "ad_catalog") +; FOREACH item = d.query("SELECT id,name FROM t_labels"); item.id; " has "; item.name; END; %]
I am trying to figure out, what is wrong in the template code.use DBI; my $dbh = DBI->connect('dbi:AnyData(RaiseError=>0):'); $dbh->func( 't_labels', 'CSV', '/tmp/demo_labels.csv', 'ad_catalog' ); my $query = qq!SELECT id,name from t_labels!; my $sth = $dbh->prepare($query); $sth->execute(); while ( my $row = $sth->fetchrow_hashref ) { print $row->{name}, "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBD:AnyData with TT
by Asim (Hermit) on Jun 16, 2006 at 11:32 UTC | |
|
Re: DBD:AnyData with TT
by Joost (Canon) on Jun 15, 2006 at 18:58 UTC | |
by artist (Parson) on Jun 15, 2006 at 19:14 UTC | |
|
Re: DBD:AnyData with TT
by davidrw (Prior) on Jun 16, 2006 at 03:08 UTC | |
|
Re: DBD:AnyData with TT
by Anonymous Monk on Jun 16, 2006 at 05:16 UTC |