in reply to Re^2: Returning multiple rows from pgplsql to DBI
in thread Returning multiple rows from pgplsql to DBI
Untested but try SELECT * FROM function() with sort on the results set (not in the function). For example
pojsub mmgb_getAllBooks { my $self = shift; my $dbh = $self->dbh; my %parm = @_; my $p1 = $parm{mmgr_shortname} ? "character varying '$parm{mmgr_shor +tname}'" : 'NULL'; my $p2 = $parm{direction} ||= 'ASC'; my $sql = "SELECT * FROM mmgb_getAllBooks($p1) ORDER BY c7 $p2"; my $sth = $dbh->prepare($sql); $sth->execute(); return $sth->fetchall_arrayref(); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Returning multiple rows from pgplsql to DBI
by anonymized user 468275 (Curate) on May 31, 2018 at 22:31 UTC | |
by poj (Abbot) on Jun 01, 2018 at 09:33 UTC | |
by anonymized user 468275 (Curate) on Jun 04, 2018 at 16:27 UTC |