On Wed, 13 Feb 2002, H.Merijn Brand wrote:
>On Wed 13 Feb 2002 02:02, Jonathan Leffler <[EMAIL PROTECTED]> wrote:
>> -The next thing is you really execute the statement. Note that you must
>> -prepare the attributes NUM_OF_FIELDS, NAME, ... when the statement is
>> -successfully executed if you have not already done so: They may be used even
>before a potential
>> -I<fetchrow>. In particular you have to tell DBI the number of fields,
>> -that the statement has, because it will be used by DBI internally.
>> +The next thing is you really execute the statement.
>> +Note that you must prepare the attributes NUM_OF_PARAMS, NUM_OF_FIELDS,
>> +NAME, etc when the statement is successfully executed if the driver has
>> +not already done so.
>> +They may be used even before a potential I<fetchrow>.
>> +In particular you have to tell DBI the number of fields, that the
>> +statement has, because it will be used by DBI internally.
>
>Maybe mention that these attributes might act different on positional
>parameters and returned values. For example in the DEC port of DBD-Unify,
>accessing the NAME field of positional parameters dumps core, where it works
>fine in the returned values. This is due to the database, not the DBD program.
>I've tested that with stand-alone code which also fails. (I have no DEC
>machines anymore, so I cannot test newer releases)
>
>Unify might be the odd one out here, but as this is aguideline to new DBD
>authors (and a reference to existing DBD authors that want to update their
>drivers to the latest DBI), it might be worth mentioning.
I need some clarification here...
Positional parameters = 'input parameters'?
That is, positional parameters are the values supplied to
the execute statement for placeholders?
Return values = 'output parameters'?
That is, the return values are the values in the select-list
of a SELECT statement?
Under Informix, the input parameters do not have names at all. I
thought the $sth->{NAME} stuff only applied to the output parameters.
Am I missing something? How do you get at the names of the positional
parameters in DBI? Which DBMS provide names for the positional
parameters? Given that some (possibly old) variants on preparse()
expect :name notation to mark a placeholder, I can see that you could
derive a name for such parameters. Informix does not support that
notation, and has a separate meaning for the syntactic fragment
(dbase@server:owner.table or dbase:table or dbase:owner.table) so it is
not feasible to have DBI add such support for DBD::Informix.
--
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!