On Thu, May 25, 2006 at 11:48:33AM -0700, David Wheeler wrote:
> The examples under "Data Types for Column Binding" don't execute.
> This is because the second argument to bind_col() should be a scalar
> ref, and the examples just use C<undef>. Should it be C<\undef>?
The undef means don't actually bind, just set the data type of the column.
When you say "don't execute", what do you mean?
Uh, hang on, now I look at the code I see it's not checking for an undef.
I guess you're getting "Can't %s->bind_col(%s, %s,...), need a reference to a
scalar"
Right?
Tim.
> Best,
>
> David
>
>
> Index: DBI.pm
> ===================================================================
> --- DBI.pm (revision 6348)
> +++ DBI.pm (working copy)
> @@ -5893,7 +5893,7 @@
> The C<\%attr> parameter can be used to hint at the data type
> formatting the column should have. For example, you can use:
>
> - $sth->bind_col(1, undef, { TYPE => SQL_DATETIME });
> + $sth->bind_col(1, \undef, { TYPE => SQL_DATETIME });
>
> to specify that you'd like the column (which presumably is some
> kind of datetime type) to be returned in the standard format for
> @@ -5908,7 +5908,7 @@
> directly, in place of the C<\%attr> hash reference. This example is
> equivalent to the one above:
>
> - $sth->bind_col(1, undef, SQL_DATETIME);
> + $sth->bind_col(1, \undef, SQL_DATETIME);
>
> The C<TYPE> value indicates the standard (non-driver-specific) type for
> this parameter. To specify the driver-specific type, the driver may
>