in reply to Code flow not going to while loop
Good grief -- I didn't even notice that you weren't using placeholders. I was too focused on sorting out the array error.
Short answer: Always use placeholders. Your code should look more like this:
Finally, in general, it's better programming practice (in any language) to deal with references and not arrays. In this context, getting the arrayref is better than asking for an array.my $sql = "select distinct FID_CUST from session " . "where DAT_END between ? and ?"; print "sql is $sql\n"; my $sth = $dbh->prepare($sql); $sth->execute( $key, $hash{$key} ) or die "Couldn't execute statement: $DBI::errstr";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Code flow not going to while loop
by dipit (Sexton) on Aug 02, 2017 at 15:44 UTC | |
by hippo (Archbishop) on Aug 02, 2017 at 15:50 UTC | |
by dipit (Sexton) on Aug 02, 2017 at 18:15 UTC |