Automating binding the parameter type
From: Bart Lateur (bart.lateur_at_pandora.be)
Date: 04/19/04
- Next message: Dean Arnold: "Re: Automating binding the parameter type"
- Previous message: Ron Reidy: "RE: performance problem with dbd oracle"
- Next in thread: Dean Arnold: "Re: Automating binding the parameter type"
- Reply: Dean Arnold: "Re: Automating binding the parameter type"
- Reply: Tim Bunce: "Re: Automating binding the parameter type"
- Maybe reply: Henrik Tougaard: "RE: Automating binding the parameter type"
- Reply: Bart Lateur: "Re: Automating binding the parameter type"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: dbi-users@perl.org Date: Mon, 19 Apr 2004 17:16:02 +0200
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.
- Next message: Dean Arnold: "Re: Automating binding the parameter type"
- Previous message: Ron Reidy: "RE: performance problem with dbd oracle"
- Next in thread: Dean Arnold: "Re: Automating binding the parameter type"
- Reply: Dean Arnold: "Re: Automating binding the parameter type"
- Reply: Tim Bunce: "Re: Automating binding the parameter type"
- Maybe reply: Henrik Tougaard: "RE: Automating binding the parameter type"
- Reply: Bart Lateur: "Re: Automating binding the parameter type"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|