Reputation: 11
I am looking to create a procedure that returns another stored procedure DLL
by its name but do not know how to do it exactly. Here is what I have tried so far:
example output
SET TERM ^ ;
CREATE or ALTER PROCEDURE MY_REPORTS (
objid my_id)
returns (
docdate my_datetime)
as
begin
some body
end^
SET TERM ; ^
Your advice is highly appreciated.
Upvotes: 1
Views: 2107
Reputation: 23
You need access to "System Tables" like RDB$PROCEDURES and RDB$PROCEDURE_PARAMETERS.
select p.RDB$PROCEDURE_NAME, p.RDB$PROCEDURE_SOURCE, pr.RDB$PARAMETER_NAME,
pr.RDB$PARAMETER_TYPE, iif(pr.RDB$PARAMETER_TYPE=0,'INPUT','OUTPUT') PARAM_TYPE
from RDB$PROCEDURES p
left join RDB$PROCEDURE_PARAMETERS pr on p.RDB$PROCEDURE_NAME=pr.RDB$PROCEDURE_NAME
where p.RDB$PROCEDURE_NAME='CALCULAVTO'
order by pr.RDB$PARAMETER_TYPE, pr.RDB$PARAMETER_NUMBER
Upvotes: 2