Calling stored procedure dynamically from PB Script

Situation:
I have a Customer table. For each customer one stored procedure is assigned which is saved in a column in the Customer table.
When I am viewing a customer, then respective stored procedure has to be called. There are 1000 customers and each customer has his own stored procedure, so there are 1000 stored procedures.
Each of these stored procedures accept 3 string arguments and return one integer value.

Ex.
String ls_Cust_sp_name

ls_Cust_sp_name = 'sp_macdonalds_budget' // This value is retrieved from the table for the selected customer

// Standard way of calling a stored procedure, where the stored proc actual name is called,
// DECLARE lsp_validate_sp PROCEDURE FOR sp_macdonalds_budget(:ls_Budget_ID, :ls_Status_ID, :ls_Resp_Person ); // Here stored proc name is hardcode, hence does not server my purpose and it is not optimized.
// EXECUTE lsp_validate_sp;

Hope this will work but I am not sure how you can get return value. Instead pass one value as reference i mean as out parameter and i think then you will be able to get that value once this statement is executed.

Featured Post

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into.
One of these problems is selecting and deleti…

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…

The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database.
Open Services Panel:
Create a new connection using New Connection Wizard:
Create a test database called eetutorial:
Create a new test tabel called ee…