Edmund Dengler wrote:
- if ( MapiLib::mapi_get_querytype($hdl) != 3 ) { +# if ( MapiLib::mapi_get_querytype($hdl) != 3 ) { +# $sth->{monetdb_rows} = $rows; +# return $rows || '0E0'; +# } + if ( MapiLib::mapi_get_querytype($hdl) == 0 ) { # Was a 0 meant here ??? $sth->{monetdb_rows} = $rows; return $rows || '0E0'; }
(2) The second group was because I was getting a "statement not marked as Active" type error from DBI after a $sth->execute(). It is a complete hack just to get testing done, without digging to determine if this is the right correction (ie, what I did is most likely wrong and needs fixing). This may be a case of MIL vs SQL again.
Like ODBC and SQL/CLI, DBI doesn't provide separate methods for queries and DML, but only one common execute method. In this method, DBD::monetdb avoids to equip the statement handle with the full set of attributes, which are necessary only for the fetch loop, if mapi_get_querytype != 3. However, in a MIL session, mapi_get_querytype seems to return always -1. I could omit the shortcut described above in a MIL session and always establish a 'fetch-able' handle:
if ( MapiLib::mapi_get_querytype($hdl) != 3 && $dbh->{monetdb_language} eq 'sql') { $sth->{monetdb_rows} = $rows; return $rows || '0E0'; }
Any objections?
I'll also forward this one to the MAPI experts: Sjoerd, Fabian? Stefan
Steffen
-- | Dr. Stefan Manegold | mailto:Stefan.Manegold@cwi.nl | | CWI, P.O.Box 94079 | http://www.cwi.nl/~manegold/ | | 1090 GB Amsterdam | Tel.: +31 (20) 592-4212 | | The Netherlands | Fax : +31 (20) 592-4312 |