Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
where $reg_num_values[0]=$month_values[0]
my @reg_num = qw/12345 98564 33234 112345 87564 2345678 938566 1234486 + 223456 123488/; my @month = qw/03 01 01 10 05 11 03 05 02 09/; my $dbh = DBI->connect("DBI:ODBC:$myserver",$u, $p,); my $reg_num_values = join("," ,map { $dbh->quote($_) } @reg_num ); my $month_values = join("," ,map { $dbh->quote($_) } @month ); my $statement = "SELECT name, last_name, reg_num, month, year FROM members WHERE reg_num IN ($reg_num_values) AND month IN ($month_values) AND year='2009' my $sth = $dbh->prepare($statement); $sth->execute();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Query using more than one array!
by ELISHEVA (Prior) on May 13, 2009 at 06:11 UTC | |
|
Re: Query using more than one array!
by CountZero (Bishop) on May 13, 2009 at 06:13 UTC | |
by Anonymous Monk on May 13, 2009 at 10:45 UTC | |
by afoken (Chancellor) on May 13, 2009 at 10:51 UTC | |
by Anonymous Monk on May 13, 2009 at 12:02 UTC | |
by CountZero (Bishop) on May 13, 2009 at 20:04 UTC | |
|