Fwd: questions about SQL::Statement
Jens Rehsack <[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.dbi.general |
|---|---|
| Message-ID | <[email protected]> |
-------- Original-Nachricht -------- Betreff: questions about SQL::Statement Datum: Mon, 19 Mar 2012 16:59:46 -0400 Von: Philip Goetz <[email protected]> An: [email protected] The module SQL::Statement doesn't work as your documentation describes. There is no column_defs function defined. There is a 'columns' function, but it returns an empty list. For example: use SQL::Parser; use SQL::Statement; my $query = "SELECT a, b, c FROM bar"; our $SqlParser = SQL::Parser->new() or die "Could not create an SQL::Parser"; my $parse = SQL::Statement->new($query, $SqlParser); # my @columns = $parse->column_defs(); <-- crashes with Can't locate object method "column_defs" via package "SQL::Statement" my @columns = $parse->columns(); foreach my $col (@columns) { my ($table, $name) = ($col->table(), $col->name()); print "$table\t$name\n"; } does not crash, but prints nothing. Do you know how to retrieve the columns from an SQL::Statement object? Thanks, Phil