> > How can I execute both (a) and (b) in my perl script?
>
> The same way you would execute any two statements, one at a
> time. Something like:
>
> $conn->do('SET [at] row=3D0');
> my $sql =3D 'SELECT [at] row:=3D [at] row+1 as row, <fields> FROM
> <tables> WHERE ...';
> my $sth =3D $conn->prepare($sql);
> $sth->execute();
> return $sth->fetchall_arrayref( {} );
Well, that's exactly what I was looking for. Thank you sooooo much.
> You are returning an arrayref! One row in your results
> equals one row in your
> array -- in the same order! Arrays are indexed, so display
> data order is
> already built into your array. Display position =3D array
> position + 1. Why do
> you need a redundant field in each row?
The arrayref resultset, being an array, does have an index, but that is =
implicit. I need to have a separate field so that the receiver can map =
each field to some place-holder in her construct. To be more exact, I =
am using a template system that uses the received arrayref to populate =
its place-holders, and <row> is one of them.
Thanks again,
Nishi
--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=3Dgcdmp-msql-mysql-modules [at] m.gmane.org
