I'm working on a next generation of a DBI abstraction module...

Sometimes it's necessary to specify the type of placeholder parameter,
like 

        use DBI ':sql_types';
        $dbh = DBI->connect(...);
        $sth = $dbh->prepare(...);
        $sth->bind_param(1, undef, SQL_INTEGER);
        $sth->bind_param(2, undef, SQL_VARCHAR);
        $sth->execute($param1, $param2);

My question is, assuming I have fetched a

        $sth1  = $dbh->prepare(...);
        $sth1->execute();

on the same table, before, is it safe to do:

        for my $i (0 .. $#fields) {
            $sth->bind_param($i+1, undef, $sth1->{TYPE}[$i]);
        }

or are the values that the attribute TYPE holds, not compatible with
this?

-- 
        Bart.

Reply via email to