Error in designer (maybe) - Stored Procedures

Posts   
 
    
ianvink
User
Posts: 393
Joined: 15-Dec-2006
# Posted on: 08-Feb-2013 00:07:03   

Using the Entity Framework 4.

I have a stored procedure which returns a single value. LLBL is not sure of the field so it calls it "IllegalName".

When I try to gen the code, it fails (see attached screenshot).

Strangely, and this may be an error, if I click on the "Target element name" then click off, the error goes away and LLBL will then generate the code no problem and everything works.

Is there a way to make to not get an Illegal name field?

Attachments
Filename File size Added on Approval
Untitled.png 88,157 08-Feb-2013 00:07.14 Approved
daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 08-Feb-2013 06:57:29   
David Elizondo | LLBLGen Support Team
ianvink
User
Posts: 393
Joined: 15-Dec-2006
# Posted on: 08-Feb-2013 18:01:02   

Version 3.5, released Dec 11th, 2012

The stored procedure just returns a single value and looks like this (redacted):

CREATE PROCEDURE [dbo].XXX @POSTAL_CODE VARCHAR(10), @CORP_NAME VARCHAR(100), @CLIENT_NUM VARCHAR(6) AS

SELECT COUNT(*) FROM XXXX.dbo.LEGAL_ENTITY LE INNER JOIN XXXX.dbo.TTTT CLE ON LE.LEGAL_ENTITY_SYSID = CLE.LEGAL_ENTITY_SYSID INNER JOIN XXXX.dbo.TTTT C ON CLE.CLIENT_SYSID = C.CLIENT_SYSID INNER JOIN XXXX.dbo.TTTT ADDR ON LE.ADDRESS_SYSID = ADDR.ADDRESS_SYSID WHERE SUBSTRING(UPPER(LE.ENTITY_NAME), 1, 10) = SUBSTRING(UPPER('' + @CORP_NAME + ''), 1, 10) AND REPLACE(UPPER(ADDR.POSTAL_CODE), ' ', '') = REPLACE(UPPER('' + @POSTAL_CODE + ''),' ','') AND UPPER(C.CLIENT_NUM) = @CLIENT_NUM

GO

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 09-Feb-2013 06:27:14   

Your LLBLGen build is a little bit old. Please update to the latest one (full installer).

I can't reproduce the validation error you are having, however I think it's because LLBLGen doesn't have information on the target mapped field. You can overcome that if you give a name for the filed in your SP:

CREATE PROCEDURE [dbo].XXX
...
AS

SELECT COUNT(*) AS TheCount FROM ...
...
GO
David Elizondo | LLBLGen Support Team