Tim,
Would you mind if DBI held constants, exportable via sql_types for
SQL_CURSOR_XXXXX.
I have a patch submitted to me for DBD::ODBC which allows multiple queries
to run concurrently under SQL*Server. The patch coerced someone using it
to:
use DBI;
use DBD::ODBC;
my $dbh = DBI->connect($DSN, $user, $pass, { odbc_cursor_type =>
DBD::ODBC::SQL_CURSOR_DYNAMIC });
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
My line of thinking (in order of preference) is as follows:
1) I'd prefer that the user could
use DBI qw(:sql_types) and get these types imported
2) Just have them use constants (1, 2, 3), but that's less "obvious"
3) Put them into DBD::ODBC.
The reason I don't like 3 is that forces a user to use a specific driver
instead of just DBI. It's a minor thing, overall, but I think it's better
for those cross-platform scripts to NOT specify a driver anywhere except in
the connect. I realize that is oversimplification of reality, given
different dialects of SQL, etc, so I don't feel strongly about it, just
strong enough to ask you in an e-mail if you'd accept a patch which adds the
four (or 5 if you add SQL_CURSOR_TYPE_DEFAULT) to the mix.
SQLEXT.H:/* SQL_CURSOR_TYPE options */
SQLEXT.H:#define SQL_CURSOR_FORWARD_ONLY 0UL
SQLEXT.H:#define SQL_CURSOR_KEYSET_DRIVEN 1UL
SQLEXT.H:#define SQL_CURSOR_DYNAMIC 2UL
SQLEXT.H:#define SQL_CURSOR_STATIC 3UL
SQLEXT.H:#define SQL_CURSOR_TYPE_DEFAULT SQL_CURSOR_FORWARD_ONLY /*
Default value */
Please advise if you agree or not.
Thanks,
Jeff