use strict; use Data::Dumper; use DBIx::Connect; use DBIx::Recordset; $DBIx::Recordset::Debug = 2; my @scf = (902 .. 908, 917, 926 .. 928); # scf is a zip prefix use vars qw(*zipset); *zipset = DBIx::Recordset->Search ({ '!DataSource' => DBIx::Connect->to('mdb_test'), '!Table' => 'customer', '*zip' => 'LIKE', 'zip' => [ map { $_ . '%' } @scf ], '$max' => 10 }); my $count; while (my $rec = $zipset->Next) { print Dumper($rec); exit if ++$count > 10; }
tbone@MDB:/data/tbone/maldunn/204209-007 perl query.pl DB: Use already open dbh for database=test;host=localhost (id=1, numO +pen = 0) DB: 'SELECT * FROM customer WHERE ( (zip LIKE ?) or (zip LIKE ?) + or (zip LIKE ?) or (zip LIKE ?) or (zip LIKE ?) or (zip LIKE + ?) or (zip LIKE ?) or (zip LIKE ?) or (zip LIKE ?) or (zip L +IKE ?) or (zip LIKE ?)) LIMIT 0,11' bind_values=<902% 903% 904 +% 905% 906% 907% 908% 917% 926% 927% 928%> bind_types=<12 12 12 12 12 + 12 12 12 12 12 12> $VAR1 = { ... }; $VAR1 = { '... };
Carter's compass: I know I'm on the right track when by deleting something, I'm adding functionality.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Check out my Recordset
by mpeppler (Vicar) on Oct 09, 2003 at 23:54 UTC | |
|
Re: Check out my Recordset
by Ovid (Cardinal) on Oct 10, 2003 at 01:55 UTC | |
by princepawn (Parson) on Oct 10, 2003 at 04:26 UTC | |
|
Re: Check out my Recordset
by jdtoronto (Prior) on Oct 10, 2003 at 03:06 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |