Determining resultsets

Posts   
 
    
IowaDave
User
Posts: 83
Joined: 02-Jun-2004
# Posted on: 14-Sep-2005 20:56:59   

I use SqlServer's way of determining resultsets, so if it fails, it's sqlserver's fault

How does sqlserver determine the number of resultsets. I'm looking for a way to force DataTable to DataSet for all retrieval sprocs. Is there a way to manipulate the number programmatically before llblgen gets it? Then I would not have to go through the catalog each time I create a new sproc.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 14-Sep-2005 22:04:22   

SET FMTONLY ON exec proc SET FMTONLY OFF

That's how it's done. I use the SqlClient and it generates this code under the hood. It's not failproof though.

a proc with 2 selects, will end up with '2' in the list of procs for the # of resultsets.

Frans Bouma | Lead developer LLBLGen Pro
IowaDave
User
Posts: 83
Joined: 02-Jun-2004
# Posted on: 16-Sep-2005 19:49:48   

Since that technique seems a little unreliable, may I suggest a project configuration feature:

Allow definition of a stored procedure naming prefix "Retrieve Procs Prefix" that could be set at the LLBLGen project level and a project setting eg "All Retrieve Procs Return DataSet"

Then I could say all sprocs that begin with "ret_" are retrieval procedures and that all retrieval procs return a DataSet. Then I can set standards in the department so there is never a question about what a sproc returns.

Thanks,

Dave

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 16-Sep-2005 20:16:02   

This is solved already in a different way (because the auto-detect is indeed unreliable).

In preferences, enable the preferences to manually set the stored proc resultset and manually select the procs to include. This pops up a dialog in which you can filter with for example "ret_" to select a set of procs and set the resultset value in 1 go.

This is reliable and easy. simple_smile

Frans Bouma | Lead developer LLBLGen Pro
IowaDave
User
Posts: 83
Joined: 02-Jun-2004
# Posted on: 16-Sep-2005 22:40:33   

In preferences, enable the preferences to manually set the stored proc resultset and manually select the procs to include

I'm sorry, you lost me. I don't understand how to make that happen.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 16-Sep-2005 23:13:53   

IowaDave wrote:

In preferences, enable the preferences to manually set the stored proc resultset and manually select the procs to include

I'm sorry, you lost me. I don't understand how to make that happen.

In teh designer, go to file -> preferences.

Then under 'Schema Element Retrieval', you've to set 'SqlServerAutoDetermineSProcType' to false and 'ManualSelectSProcsFromSchema' to true.

Then refresh the catalog, you'll get a dialog which allows you to set the values for the resultset and which procs you want to include in the catalog simple_smile

Frans Bouma | Lead developer LLBLGen Pro
IowaDave
User
Posts: 83
Joined: 02-Jun-2004
# Posted on: 19-Sep-2005 18:37:55   

Thanks, that's exactly what I needed stuck_out_tongue_winking_eye