select from UDF

Posts   
 
    
idsn11
User
Posts: 39
Joined: 06-May-2008
# Posted on: 04-May-2011 11:35:13   

Hi! Other simple question:

I have complex sql-function GetAllowedUserIdList that has one parameter (Guid) and returns multiple rows with single column of Guid (uniqueidentifier) type. How I can correctly read this data?

I do not want to wrap this function into stored procedure. Are there other ways?

idsn11
User
Posts: 39
Joined: 06-May-2008
# Posted on: 04-May-2011 14:55:06   
  1. I've found the thread http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=11573&StartAtMessage=0&#64617. In some cases it is the way.

  2. I can realize function code generation task in custom task performer (like RetrievalProcedures behaviour)

But question is the same...

idsn11
User
Posts: 39
Joined: 06-May-2008
# Posted on: 05-May-2011 09:36:22   

Are there other ways? More convenient and simple

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 06-May-2011 07:33:02   

idsn11 wrote:

Are there other ways? More convenient and simple

I'm afraid not. As I see your options are: A. Use a stored procedure, then you can call the SP from LLBLGen code, or project it to an entity or a custom class. B. Use a view that joins to your UDF, then you can map that view in LLBLGen. C. Use the workaround mentioned in your above link (modify a bit the way sql is generated). Did you try that code? (http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=11573&StartAtMessage=0&#64617)

David Elizondo | LLBLGen Support Team
idsn11
User
Posts: 39
Joined: 06-May-2008
# Posted on: 06-May-2011 08:05:34   

Understood.

Choise C is not suitable for me.

I'll realize two classes (ActionFunctions/RetrievalFunctions) generation (like ActionProcedures/RetrievalProcedures) with TaskPerformers (useful in the future).

Thanks for the answer.