[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: Den tomme mængde i SQL.



On Wed, 4 Jan 2006 19:48:03 +0000 (UTC), Jesper wrote:

> select * from table where id in (join(",",@ids));

Den simple måde at håndtere det på er at flytte logikken over i - det
ligner - Perl.

A la:

 my @results=();
 @results=return_an_array_from_sql('select * from table where id in (' .
            join(",",@ids) . ');') if (scalar(@ids));

Så sparer du også et (lillebitte) database-opslag :-)

Endnu rarere var det måske at blive helt fri for at konstruere SQL
selv, v.hj.a. Class::DBI, Alzabo, DBIx::* eller andre hjælpere.


  Mvh.

-- 
 "Faktum er, at Delphi er det bedste all-round værktøj,       Adam Sjøgren
  der eksisterer i dag. Og mest produktive."             sslug@sslug


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2006-02-01, 02:01 CET [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *