Subject | Re: [IBO] Trigger and Stored Procedures |
---|---|
Author | Nando Dessena |
Post date | 2003-12-03T16:59:24Z |
Ronald,
r> no. 2 again :
r> How can I extract the metadata of a stored procedure / trigger like :
r> ALTER PROCEDURE PROCEDURENAME (VALUE1 INTEGER,
r> VALUE2 VARCHAR(10))
r> returns (RESULT1 VARCHAR(5),
r> RESULT2 INTEGER,
r> RESULT3 INTEGER)
r> AS
r> declare variable ...;
r> declare variable ...;
r> declare variable ...;
r> begin
r> ...
r> end
as I suggested you before, you should have a look at the system
tables. RDB$PROCEDURES and RDB$PROCEDURE_PARAMS hold all the data you
need. If you don't want to reinvent the wheel, have a look at how the
metadata extract component in IBO does it.
r> I tried to get it with schemacash, as you wrote me, but I cant find
r> the right method which could do this.
SchemaCache won't help you past point 1 I fear. :-)
r> Is it the Procedure :
r> Procedure ExtractStoredProcedure(SQL: string; var StoredProcName:
r> string; const ParamNames: TStrings; ParamChar: char );
r> or the Procedure :
r> GetStoredProcedureSource(SP_Alter: boolean; SP_Name: string; SP_DSQL:
r> TIB_Statement; SP_Body: string ): string;
r> If it is one of both, which are the right parameters ?
I simply don't know <g>. If I were you I'd look at the metadata
extract component sources.
r> Maybe I have the wrong one. Could you get me the exact name of it,
r> please?
Again the metadata extract component sources might be of use. Anyway,
the system table you need to explore here is RDB$TRIGGERS.
HTH
--
Nando mailto:nandod@...
r> no. 2 again :
r> How can I extract the metadata of a stored procedure / trigger like :
r> ALTER PROCEDURE PROCEDURENAME (VALUE1 INTEGER,
r> VALUE2 VARCHAR(10))
r> returns (RESULT1 VARCHAR(5),
r> RESULT2 INTEGER,
r> RESULT3 INTEGER)
r> AS
r> declare variable ...;
r> declare variable ...;
r> declare variable ...;
r> begin
r> ...
r> end
as I suggested you before, you should have a look at the system
tables. RDB$PROCEDURES and RDB$PROCEDURE_PARAMS hold all the data you
need. If you don't want to reinvent the wheel, have a look at how the
metadata extract component in IBO does it.
r> I tried to get it with schemacash, as you wrote me, but I cant find
r> the right method which could do this.
SchemaCache won't help you past point 1 I fear. :-)
r> Is it the Procedure :
r> Procedure ExtractStoredProcedure(SQL: string; var StoredProcName:
r> string; const ParamNames: TStrings; ParamChar: char );
r> or the Procedure :
r> GetStoredProcedureSource(SP_Alter: boolean; SP_Name: string; SP_DSQL:
r> TIB_Statement; SP_Body: string ): string;
r> If it is one of both, which are the right parameters ?
I simply don't know <g>. If I were you I'd look at the metadata
extract component sources.
r> Maybe I have the wrong one. Could you get me the exact name of it,
r> please?
Again the metadata extract component sources might be of use. Anyway,
the system table you need to explore here is RDB$TRIGGERS.
HTH
--
Nando mailto:nandod@...