On 3-21-13 22:55:51 Garry T. Williams wrote:
> On 3-21-13 21:44:46 dome stuff wrote:
> > my $sth = $dbh->prepare('SELECT (formid, fid, forder, ftype, fsize,
> > fmaxlength, fdesc, flink) FROM fdesc WHERE (formid = ?) ORDER BY forder') ;
> 
> my $sth = $dbh->prepare(<<SQL);
> SELECT formid, fid, forder, ftype, fsize,
>        fmaxlength, fdesc, flink
>   FROM fdesc
>  WHERE formid = ?
>  ORDER BY forder
> SQL
> 
> In other words, lose the parentheses in the SELECT clause.

I should have mentioned that the parentheses constitute a Row
Constructor.  This is a composite Value Expression.  A Row Constructor
is valid in the SELECT clause.

See 
http://www.postgresql.org/docs/9.2/interactive/queries-select-lists.html#QUERIES-SELECT-LIST-ITEMS
 
    http://www.postgresql.org/docs/9.2/interactive/sql-expressions.html .

-- 
Garry T. Williams

Reply via email to