Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: how do i construct a sql select statement, where i want to get the where clauses out of an array

by Corion (Patriarch)
on Aug 25, 2001 at 20:40 UTC ( [id://107839]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub selectAll {
      my ($what,$table,@clauses);
    ...
      $sth->execute() or die "SQL: selectAll: '$statement' failed.";
      return $sth->fetchall_arrayref();
    };
    
  2. or download this
    my $sthGetFile = $dbh->prepare("select VISUAL,LINK from FILES where (I
    +D=?)");
    
    ...
    
    # Assuming $id exists in the table
    print getFile($id)->[1];
    
  3. or download this
    my @id = (1,2,3,4,6,7,8);
    my $clause = "";
    ...
    
    my $statement = "select ID,COLOR from TABLE $clause";
    ...
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://107839]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-25 18:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found