I am looking to populate my template loop by assigning it the entire resultset in one shot as follows: my $str = "SELECT [EMAIL PROTECTED]:[EMAIL PROTECTED] as row, <fields> FROM <tables> WHERE ..."; my $sth = $conn->prepare($st); $sth->execute(); my $dataArr = $sth->fetchall_arrayref( {} ); $template->param(dataLoop => $dataArr);
I am getting NULL for row. The solution suggested by following thread does it for command line, but I need to run it from inside my perl script. http://lists.mysql.com/mysql/185626 a) SET @row=0; b) SELECT (@row:[EMAIL PROTECTED]) AS row, ename, empno FROM emp ORDER BY empno; And I don't know how to run both (a) and (b) together in one statement. Running just (b) is what is producing NULL for row. Thanks for your help, Nishi ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click _______________________________________________ Html-template-users mailing list Html-template-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/html-template-users