
I understand why do you point on this feature. I see that Oracle supports
such feature natively, stored procedures can return multiple results and
native API support working with result sets. This specific feature can be
added exclusively for Oracle driver. While the `Connection` is just a
typeclass you can define any functions you need in the driver. For example
hdbi-postgresql driver exports function `pgAffectedRows` which return the
count of rows affected by executed statement. SQLite have no such function,
thats why this is not in `Connection` typeclass. The same is posible for
i.e. `OracleStatement` type: you can just implement additional functions in
the driver and export them. Note, this is not true for HDBC because the
`Statement` is data in HDBC but not typeclass.
2013/10/16 Gauthier Segay
I got it Alexey, thanks.
I wasn't aware that this feature is not widespread in RDBMS, indeed postgresql and sqlite are not exposing it; so this would require some added complexity in those drivers without added benefits since it would be equivalent to sending separate statements.
Now I understand what you want, but it looks like something strange. Why dont just execute many statements and accumulate them in some container and after that fetch results of this statements ? For me It looks like something foreign in HDBI especially because I did not see any support of such
On Wed, Oct 16, 2013 at 5:50 PM, Alexey Uimanov
wrote: things in native database interfaces not in Postgresql nor in SQlite.
2013/10/16 Gauthier Segay
no the use case is to issue a bunch of disparate select statements, i.e. retrieving data from several tables in a single roundtrip.
select 1,2,3
select 'a', 'b'
In this case, I'd like to call the API in this manner (or something better):
-- statement is prepared rows1 <- fetchAllRows statement _ <- nextResults statement rows2 <- fetchAllRows statement -- continue
right now, with hdbc-odbc (nextResults doesn't exist though so I don't call it) rows2 will be an empty list, I'd expect it to be[(SqlText "a"), (SqlText "b")]
I assume in the case of odbc, the related C function is SQLMoreResults
http://msdn.microsoft.com/en-us/library/ms714673%28v=vs.85%29.aspx
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe