What about supporting references in bind_param ()

    my ($a, $b, $v);
    my $stx = $dbh->prepare ("select a, b from x where v = ?");
    $stx->bind_columns (\$a, \$b);
    $stx->bind_param (1, \$v);  # Note the reference
    
    my $sty = $dbh->prepare ("select v from y");
    $sty->bind_columns (\$v);
    $sty->execute;
    while ($sty->fetch) {
        $stx->execute &&    # execute uses current $v
            $stx->fetch or next;
        # $v, $a and $b now valid
        :
        }

-- 
H.Merijn Brand    Amsterdam Perl Mongers (http://www.amsterdam.pm.org/)
using perl-5.6.1, 5.7.1 & 626 on HP-UX 10.20 & 11.00, AIX 4.2, AIX 4.3,
 WinNT 4, Win2K pro & WinCE 2.11 often with Tk800.022 &/| DBD-Unify
ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/

Reply via email to