Stored Procedure Error on Refreshing Catalog

Posts   
 
    
Fred avatar
Fred
User
Posts: 21
Joined: 04-Mar-2005
# Posted on: 07-Mar-2005 23:14:49   

I made a change to a database table (SQL Server), switching a nullable field to non-nullable, and then refreshed my LLBLGen Pro project's catalog. The refresh produced this error:

RefreshCatalog::Stored procedure 'UserDocumentCategoryCount_get' caused an SqlServer error 0. This stored procedure is no longer reported as having a resultset. RefreshCatalog::Index #0 Message: Invalid object name '#FredsData'. Number: 208 Native Error Code: 0 Source: .Net SqlClient Data Provider

FredsData is a temporary table, defined as follows:

CREATE TABLE #FredsData ( LastName varchar(30) , FirstName varchar(30) , MiddleName varchar(30) , PatientID int , VisitID int , RoomID int , Bed char(5) , Rad int , Lab int , Trans int , Path int )

It is filled with an insert from select statement. Rad, Lab, Trans and Path are count aggregates; the others are standard fields. The table's contents are selected to be returned as the resultset.

Can you tell me from this what might be the problem?

Fred avatar
Fred
User
Posts: 21
Joined: 04-Mar-2005
# Posted on: 07-Mar-2005 23:25:23   

Interesting addendum here - when I expand the stored procedure in the catalog, it shows to return 1 resultset, in spite of the error messsage to the contrary.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 08-Mar-2005 10:41:01   

I use the SqlDataAdapter's way of determining a resultset description of a stored procedure, this is done using SET FMTONLY ON;exec proc;SET FMTONLY OFF. Though this method isn't fail safe, sometimes with temptables it breaks. I can't work around this, as there is no other way to find the resultsets in sqlserver.

In 1.0.2004.2, I've solved it by allowing the user to specify the number of resultsets in a gui screen (select procs using a filter, click a button). Once this is done, refreshing is a lot faster, and it isn't failing on procs like these.

Frans Bouma | Lead developer LLBLGen Pro