Map a scalar function call in the designer

Posts   
 
    
wtijsma
User
Posts: 252
Joined: 18-Apr-2006
# Posted on: 07-Apr-2015 15:43:25   

Hi,

Is there a way I can map a scalar function call in the designer to generate type-safe calls to it?

What's the easiest way nowadays in LLBLGen 4.2 to simply execute a scalar function and get the value from it?

Thanks

Wiebe

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 07-Apr-2015 21:27:32   

You can build a Scalar Query in code, several ways to do that depending on the case. e.g. adapter.GetScalar(...);

But your case seems different as you want to call a database function that is scalar.

And if the call is not part of a query, like calling the function in a predict or in the select list, then your best bet would be to include it in a StoredProcedure, and get an SP call mapped.

If not scalar, then you can have a TableValuedFunction call mapped in the designer.

hotmail
User
Posts: 47
Joined: 06-Feb-2013
# Posted on: 08-Apr-2015 20:16:54   

Is there something in v5 that allows us to map scalar value function directly without creating an SP and is strongly typed?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 09-Apr-2015 08:23:48   

hotmail wrote:

Is there something in v5 that allows us to map scalar value function directly without creating an SP and is strongly typed?

No. You have to either code it at DB (SP or View) or at generated code, but not in the model.

David Elizondo | LLBLGen Support Team
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 09-Apr-2015 09:37:48   

For v5 it's considered, but nothing is set in stone yet.

Frans Bouma | Lead developer LLBLGen Pro
wtijsma
User
Posts: 252
Joined: 18-Apr-2006
# Posted on: 09-Apr-2015 21:20:55   

Walaa wrote:

You can build a Scalar Query in code, several ways to do that depending on the case. e.g. adapter.GetScalar(...);

But your case seems different as you want to call a database function that is scalar.

And if the call is not part of a query, like calling the function in a predict or in the select list, then your best bet would be to include it in a StoredProcedure, and get an SP call mapped.

If not scalar, then you can have a TableValuedFunction call mapped in the designer.

Cool, thanks a lot. For now wrapping it in a sproc seems like the easiest.