Call a Stored Procedure By Name?

Posts   
 
    
psandler
User
Posts: 540
Joined: 22-Feb-2005
# Posted on: 30-Apr-2007 16:37:15   

All,

Is there any way you can think of using the LLBLGen Adapter to call a stored procedure by name (as opposed to generating a strongly typed sp call)?

We are in the process of building a system that will require customizations post-production without recompiling and redeploying the code. These customizations will be handled by creating new stored procedures that conform to a specific signature/interface (same parameters and same resultset formats).

The only way I can think to do this via LLBLGen is to create a number of SP stubs (call them "SP_1", "SP_2", etc.) and generate all of them, then have a table that keeps metadata about each one (whether they are enabled, etc.).

I think this approach would work fine, but my concern is that I could create, say, 20 SP stubs, then down the road we would do an implementation that needed 21, and we would have to regen, recompile, and redeploy.

Any thoughts?

Thanks,

Phil

Aurelien avatar
Aurelien
Support Team
Posts: 162
Joined: 28-Jun-2006
# Posted on: 30-Apr-2007 17:06:28   

Hi,

maybe DbFunctionCall is the feature what you need. please check this section in the docs : Generated code - Calling a database function

JimHugh
User
Posts: 191
Joined: 16-Nov-2005
# Posted on: 30-Apr-2007 18:00:40   

Since they all use the same parameters, how about a wrapper sp that has one extra parameter that is used as a discriminator that calls the appropriate actual sp?

You could change add more "child" sp and call the appropriate one via the discriminator.

psandler
User
Posts: 540
Joined: 22-Feb-2005
# Posted on: 30-Apr-2007 18:36:06   

JimHugh wrote:

Since they all use the same parameters, how about a wrapper sp that has one extra parameter that is used as a discriminator that calls the appropriate actual sp?

You could change add more "child" sp and call the appropriate one via the discriminator.

Hmm, that's an interesting idea. I'll consider that as a possible solution.

Thanks,

Phil