Questions tagged [multiple-resultsets]

104 questions
84
votes
3 answers

Dapper.NET and stored proc with multiple result sets

Is there any way to use Dapper.NET with stored procs that return multiple result sets? In my case, the first result set is a single row with a single column; if it's 0 then the call was successful, and the second result set will contain that actual…
marc_s
  • 675,133
  • 158
  • 1,253
  • 1,388
26
votes
1 answer

How to read multiple resultset from SqlDataReader?

I have a SP from that I am trying to return 2 result set from, and in my .cs file i am trying something like this: dr = cmd.ExecuteReader(); while (dr.Read()) { RegistrationDetails regDetails = new RegistrationDetails() { FName =…
Rocky
  • 4,132
  • 11
  • 61
  • 114
25
votes
2 answers

How to pull back all parent/child data in complex object

I have these two tables with a one (category) to many (product) relationship in the database: Table Product Name Description ProductCategory Table Category Category Description And these classes: public class Product { …
LRP
  • 273
  • 1
  • 3
  • 5
15
votes
3 answers

Linq to SQL Stored Procedures with Multiple Results

We have followed the approach below to get the data from multiple results using LINQ To SQL CREATE PROCEDURE dbo.GetPostByID ( @PostID int ) AS SELECT * FROM Posts AS p WHERE p.PostID = @PostID SELECT c.* FROM…
Gourav
11
votes
1 answer

Entity Framework CTP5 - Reading Multiple Record Sets From a Stored Procedure

In EF4, this was not easily possible. You either had to degrade to classic ADO.NET (DataReader), use ObjectContext.Translate or use the EFExtensions project. Has this been implemented off the shelf in EF CTP5? If not, what is the recommended way…
RPM1984
  • 69,608
  • 55
  • 212
  • 331
9
votes
1 answer

Retrieve multiple result sets in sails js

I am using sails js with it sails-mssqlserver adapter. The problem with it is that if my stored procedure returns multiple result sets then I only receive one result set which is the latest of all. The same stored procedure is working fine with…
8
votes
2 answers

JDBC : returning multiple result sets via a single database invocation - not working for Oracle

This post showed executing multiple queries in a single JDBC invocation (against a SQL Server database) by separating them with semicolons. When I tried to do the same with Oracle 10G, an error "invalid character" propped up : class db { public…
Daud
  • 6,209
  • 15
  • 55
  • 108
6
votes
1 answer

Entity Framework Query Results Duplicate

I created a SQL View that joins a few tables and when tested in SQL Manager it provides the correct data (If a makes a difference these are complex joins). In MVC I created a (data first) Entity Data Model and then added code generation. I have a…
4
votes
1 answer

One-to-Many with no back reference in sub-related entity

If I have one-to-many relation between two entities (ie. Post and Comment) and have my master class defined as: public class Post { ... IList Comments { get; set; } } But my Comment sub-related class doesn't have a property of type…
Robert Koritnik
  • 97,460
  • 50
  • 267
  • 388
4
votes
1 answer

BLToolkit: Multiple resultsets?

I haven't found a way to retrieve two lists of objects from an SP with two select statements. Is it possible with BLToolkit, or can only hierarchical data be fetched in such a manner? I'm trying to replace a dataset containing two unrelated tables.
Carl R
  • 7,760
  • 4
  • 41
  • 76
4
votes
2 answers

Trying to load second result set from a stored procedure

I have a customer setup that uses stored procedures to return data from its SQL Server database. Those stored procedures are all built the same way - they take a bunch of input parameters, and they return: the first is just a single row, single…
marc_s
  • 675,133
  • 158
  • 1,253
  • 1,388
3
votes
2 answers

TSQL equivalent of PostgreSQL "PERFORM" keyword?

I'm testing query performance in a loop. Rather than return a hundred duplicates of a result set, I want to run a select statement hundreds of times, discarding the results each time. PostgreSQL has the syntax "perform select...", which will…
Triynko
  • 17,370
  • 20
  • 92
  • 154
3
votes
3 answers

Hibernate: Multiple Result Sets

from what I've read in the Hibernate documentation/online it sounds like Hibernate does not have the ability to handle multiple result sets. I'm looking to make a MySQL DB call in an application that relies on Hibernate, that will return multiple…
Ryan P.
  • 845
  • 2
  • 14
  • 20
3
votes
1 answer

Why can't Postgres functions that return SETOF be called from a JDBC CallableStatement?

Is there a technical reason why a JDBC CallableStatement shouldn't be used to execute a PostgreSQL stored function that returns a SETOF (in particular REFCURSOR)? Per the PostgreSQL JDBC documentation: Functions that return data as a set should…
3
votes
2 answers

Mybatis map multiple resultsets into object inner collections

Brief problem description Following guideline for multiple resultsets and with help from this answer I now able to extract 2 different recordsets but they are just list and do not mapped on result object. In details I have classes…
Hubbitus
  • 4,481
  • 2
  • 37
  • 42
1
2 3 4 5 6 7