Help for this page

Select Code to Download


  1. or download this
     perl -T your_script [args...]
    
  2. or download this
    $sql = "select * from some_table where some_col = $target";
    $sth = $dbh->prepare( $sql );
    $sth->execute;
    ...
    
  3. or download this
    $sql = "select * from some_table where some_col = ?";
    $sth = $dbh->prepare( $sql );
    $sth->execute( $target );
    
  4. or download this
    $sql = "select $colum from $table";
    
  5. or download this
    my $cols = ( foo => 'foo', bar => 'bar', baz => 'baz' );
    my $tbls = ( parts => 'parts', table2 => 'table2' );
    ...
       my $sql = "select $cols{$inp_col} from $tbls{$inp_tbl}";
       # now it's safe to run the query...
    }