Your code makes little sense to me. It also doesn't seem to be very self-contained, as it contains syntax errors.
What is the following code supposed to do?
foreach $i(0..$#{$rows}) { foreach $j (0..$#{$rows->[$i]} ) { $rows->[$i][$j]; } }
Have you tried replacing the query results with hardcoded data? Does the program work then as you want it to? If so, then the problem is with retrieving the data. If not, then the problem is how you handle the retrieved data.
The code structure here doesn't make much sense:
while ($i<=2) { my $placeholder = ":p_$j"; print "$placeholder\n"; my $rd = "$rows->[$i][0]"; print "$rd\n"; ################################ # # create a new EXCEL instance # ################################ my $Excelfile = "Q4 $rd PERFORMANCE RPT.xls"; my $excel = Spreadsheet::WriteExcel::Big->new("$Excelfile"); my $worksheet = $excel->addworksheet("Q4_STORE"); ########Create Subroutine to Select Data and insert into Worksheet#### +#### sub get_store_data {
What is the while loop supposed to do, and why do you declare a subroutine in the while loop?
Why do you spend six lines on a comment to a single line of code that says exactly what the comment says? Repeatedly? Removing these comments will make the code more understandable, because there is nothing of value added by a comment of "Prepare Query" when the code says $dbh->prepare($stmt).
############################ # # Prepare Query # ############################ my $sth = $dbh->prepare($stmt);
In reply to Re^3: SQL query using dynamic array
by Corion
in thread SQL query using dynamic array
by cocl04
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |