On Mon, Nov 26, 2001 at 09:21:49PM +0000, Tim Bunce wrote:
> On Mon, Nov 26, 2001 at 04:25:16PM +0100, Steffen Goeldner wrote:
> 
> On reflection I agree that DBI attributes should be consistently
> fetched by name, not a numeric value.

I'm having second thoughts about this.

> The $h->get_info method is still open to question. Since we have
> to provide a name to number mapping anyway then we could define the
> $h->get_info method to support either.

I think a name to number mapping could be optional.

If we drop the use of handle-attributes as a way to access SQLGetInfo()
values and just provide a $dbh->get_info($) method then that method
would naturally take a number, as per SQLGetInfo() in ODBC & SQL/CLI.

Then it's up to the developer to either pass a numeric value

  $rollback_behaviour = $dbh->get_info(24); # 24=SQL_CURSOR_ROLLBACK_BEHAVIOR

or make use of an optional name to number mapping that the DBI can
provide (but not use internally):

  use DBI qw(:get_info);
  $rollback_behaviour = $dbh->get_info(SQL_CURSOR_ROLLBACK_BEHAVIOR);

(Not using handle-attributes is a good-thing because this would
polute the attribute namespace in a messy way.)

Tim.

Reply via email to