Call a procedure inside another using dynamic sql -

Database

Call a procedure inside another using dynamic sql -

Hi -

I have req such that , i need to call a procedure inside another using dynamic sql.

there is permanent table, which has procedure column, which will be loaded from java.

Once it is loaded a report procedure will be called through perl script.

In that procedure , based on the values in the procedure column, i need to call using dynamic sql.

eg:

tbl1 -

column(proc)

get_report

replace procedure report()

sel proc into var1 from tbl1;

set var2='call '||var1 ||'()';

call dbc.sysexecsql(var2);

The above code is valid? will we be able to call a procedure inside another using dynamic sql.

Please guide....

2 REPLIES
Junior Contributor

Re: Call a procedure inside another using dynamic sql -

Dynamic SQL doesn't support CALL.

The only workaround is a huge CASE which list all CALLs to those different SPs.

Dieter

Re: Call a procedure inside another using dynamic sql -

Dieter,

Thanks for your response.

Will work on case stmts :)

Thanks.