in reply to sql select with array
One "questionable" (but fun) way of doing this is by modifying the global $" variable, which is the separator used when interpolating arrays into strings. Its default value is a single space, which explains the above situation.
Setting it to ',' yields code like this: (warning, untested)
my $sql; { local $" = ','; # localize $" for use in the next statement $sql = "select @selector from people where foo like '%bar%'" } my $row = $dbh->selectall_arrayref($sql) or die "SQL Error: $sql";
-Blake
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: sql select with array
by davorg (Chancellor) on Oct 22, 2001 at 13:35 UTC | |
by demerphq (Chancellor) on Oct 22, 2001 at 15:48 UTC | |
by blakem (Monsignor) on Oct 22, 2001 at 13:42 UTC |