Skip to content
This repository has been archived by the owner on May 24, 2023. It is now read-only.

Stored procedures and multiple resultsets #12

Closed
rvenugopal opened this issue Oct 16, 2013 · 3 comments
Closed

Stored procedures and multiple resultsets #12

rvenugopal opened this issue Oct 16, 2013 · 3 comments

Comments

@rvenugopal
Copy link

Hi

Thanks for the excellent article. I found it quite informative with lots of little gotchas. Would it be possible for you to comment on the following

  • Is it possible to work with multiple result sets
    If I have multiple select statements, then how can I ensure that I read each of the result sets individually?
  • Invoking stored procedures and passing parameters to stored procedures
  • If I include multiple statements in a transaction, does it perform a single batch i/o operation with the db or are multiple network calls made?

Thanks
-Rao

@xaprb
Copy link
Contributor

xaprb commented Oct 16, 2013

I'd be interested in other contributions to this topic because I don't know
the answers.

@arnehormann
Copy link
Contributor

...giving back to support my plea for the recently opened issue #15 ...

Multiple results: The current driver API does not support multiple result sets in any way (And there's no issue for it yet, though maybe 5171 - "database/sql: should support a way to perform bulk actions" is related).

Invoking stored procedures: driver specific. My answer from a go-sql-driver/mysql perspective is that I never used them, but it's just CALL procedurename, right? A regular call to Query or Exec should suffice - as long as only one result set is returned. First you have to patch the driver, though. Please read issue 66.

Transaction IO: As far as I know, it's one call per statement. Have a look at the source.
A driver could probably work around this, but I don't see any compelling reasons why it should.

@xaprb
Copy link
Contributor

xaprb commented Nov 29, 2013

I've added my answers here: http://go-database-sql.org/surprises/#multiple_result_sets

@xaprb xaprb closed this as completed Nov 29, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants