I would like to call a 4GL Procedure in a very dynamic way, but up to now I was not able in doing that. In order to explain my question, I provide an example.
The following works (procedure without parameters):
my_var = varchar (50);
...
my_var = 'MyProcedure';
callproc :my_var;
This executes procedure "MyProcedure".
My problem arises when I try to specify some parameters, and statically I don't know their names and the values they have to assume.
For example, let procedure MyProcedurePar be defined as follows:
PROCEDURE MyProcedurePar (
param1 = integer, param2 = integer
) = DECLARE
ENDDECLARE
BEGIN
message varchar (param1) + ' - ' + varchar (param2);
END
;
I would like to know whether exists a way for calling it without using the following syntax:
CALLPROC MyProcedurePar (param1 = 1, param2 = 2);
I would like to insert both procedure name and parameters in two varchars, i.e.:
my_proc = 'MyProcedurePar (param1 = 1, param2 = 2)'
CALLPROC :my_proc;
but it does not work, since OpenRoad considers the whole variable as the procedure name.
I tried to get the ProcHandle and use the call method, but the problem remains.
I hope somebody of you might help me.
Thanks, Sergio
Hi Hlpeng
Yes, OpenROAD supports dynamic calls, including creating, compiling and running procedures at runtime.
You can find a follow up discussion to the original question (posted in 2006) over here
Be sure to research:
International OpenROAD Users Mailing list
https://groups.google.com/forum/#!forum/openroad-users
(Send your questions to openroa...@googlegroups.com)
OpenROAD developer forum
http://community.actian.com/forum/application-development-using-openroad/
kind regards
Paul White
OpenROAD Users admin
_______________________________________________
Info-Ingres mailing list
Info-...@kettleriverconsulting.com
http://ext-cando.kettleriverconsulting.com/mailman/listinfo/info-ingres