--
Jonathan Leffler ([EMAIL PROTECTED], [EMAIL PROTECTED]) #include <disclaimer.h>
Guardian of DBD::Informix 1.04.PC1 -- http://dbi.perl.org/
--- Begin Message --- Rudy Lippan wrote:
On Wed, 26 Feb 2003, Tim Bunce wrote:
Rudy Lippan wrote:
I know there is a {NUM_OF_PARAMS} attribute and a {ParamValues} attribute,
but is there a way to get the names of :foo style params before they are
bound?

Umm, not officially currently but there's a good chance that keys %{$sth->{ParamValues}} would work on many drivers that support it.

I'll add a note to that effect in the docs so that'll become the
standard way.

Please don't. Some drivers are completely unable to support named placeholders. Specifically, DBD::Informix cannot. The notations :xxx and :23 can both appear outside quoted strings in contexts that do not have anything to do with placeholders. DBD::Informix uses its own pre-parser code for the same reason -- only question mark placeholders can work reliably. And I am 99% sure that only question marks are sanctioned by ODBC...


SELECT * FROM [EMAIL PROTECTED]:owner.table WHERE somecolumn BETWEEN
        DATETIME(1970:01:01 00:00:00) YEAR TO SECOND AND
        DATETIME(1999:12:31 23:59:29) YEAR TO SECOND

There are no placeholders in that - but there's a :owner and eight :NN values in it.

A slight downside is that it won't be possible to tell the difference
between a placeholder that's not been bound and one that has but
was bound to undef. But I don't think that'll be a big issue.
Anyone disagree?

If the system will automatically bind undef for any placeholders that have not had an explicit value bound to them, then it should be OK. Otherwise, it could be problematic - people do have to explicitly bind NULL/undef on occasion.



[...latest contribution from Rudy omitted...]


--
Jonathan Leffler ([EMAIL PROTECTED], [EMAIL PROTECTED]) #include <disclaimer.h>
Guardian of DBD::Informix 1.04.PC1 -- http://dbi.perl.org/



--- End Message ---


Reply via email to