Hi - another question:
The sample code for DBD::Driver::db::prepare starts:
sub prepare
{
my ($dbh, $statement, @attribs) = @_;
# create a 'blank' sth
my $sth = DBI::_new_sth($dbh, {
'Statement' => $statement,
});
Question: does DBI keep track of the statement text, or do the DBD
modules all have to do it?
If DBI tracks it automatically, does that make the above code wrong,
or just superfluous?
If DBI does not track it, that presumably means that the DBD FETCH
functions have to handle it, whereas if DBI does track it, then they
don't. Is the statement text a read-only attribute of the statement
handle? If not, why not, and what are the semantics of:
$sth->{Statement} = "some new SQL";
Consider the cases where the original statement is a SELECT and the
statement handle has been executed and maybe some data has been fetched,
as well as before the statement is executed and after the statement is
finished.
If DBI tracks it and the DBD also tracks it, then which one 'wins'? The
user loses, of course, because more work is being done than necessary.
But does DBI use its own version of the statement text or does it end up
using the driver's version?
I ask because DBD::Informix currently tracks Statement for itself, more
or less as implied by the code above. This has consequences for the
FETCH code (which does recognize it) and the STORE code (which declines
to do anything with it.
--
Jonathan Leffler #include <disclaimer.h>
STSM, Informix Database Engineering, IBM Data Management Solutions
Phone: +1 650-926-6921 Tie-line: 630-6921
Email: [EMAIL PROTECTED] ([EMAIL PROTECTED])
Notes ID: Jonathan Leffler/Menlo Park/IBM@IBMUS
Guardian of DBD::Informix v1.00.PC1 -- http://dbi.perl.org
*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
Please update your address book to use [EMAIL PROTECTED] because
[EMAIL PROTECTED] will not work starting 2002-07-01. Expect
slower responses because I can't use Lotus Notes as fast as Unix
email. One day, this signature will shrink!