Oracle, Stored Procedure, Multiple Result Sets Multiple Duplicate DB Calls?

Posts   
 
    
Posts: 7
Joined: 25-Feb-2013
# Posted on: 11-Jun-2013 22:47:38   

I'm looking for a solution that will parse one stored procedure call into multiple result sets without making 1:1 calls to project into each TypedView

I'm doing this:

using (DataAccessAdapter adapter = new DataAccessAdapter()) { adapter.FetchTypedView(headerDataRslt, RetrievalProcedures.GetQueryForPOHeaderDataTypedView(poID,clientID));

            adapter.FetchTypedView(attachmentDataRslt, RetrievalProcedures.GetQueryForPOAttachmentsTypedView(poID,clientID)); 

            adapter.FetchTypedView(codeDataRslt, RetrievalProcedures.GetQueryForPOGLCodesTypedView(poID, clientID)); 

            ...
        }  

Each of these request calls the SAME stored procedure over and over.. is there any way around this?

Thanks

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 12-Jun-2013 18:36:49   

You can opt for Using a DataReader, and projecting (FetchProjection) twice.

Please check Fetching DataReaders and projections for more details.

Posts: 7
Joined: 25-Feb-2013
# Posted on: 12-Jun-2013 18:48:19   

Ok, thanks for the feedback. I know that method will definately work.. but then I dont get the nice "auto-gen" into TypedView feature. I was trying to avoid creating the Objects by hand (100 or so properties in total) and crafting the mapping the projections for them. Thanks again