Page 1 of 1

How TIBCMetaData to get detail Stock Procedure

Posted: Fri 23 Sep 2016 02:01
by Haydar Aji
When I Extract Procedure using TIBCMetaData, I can't get my detail procedure using this component.

I've try this one :

Code: Select all

var 
 MetaData : TIBCMetaData;
  S : String
begin
  MetaData := TIBCMetaData.Create(Nil);
  MetaData.Connection := IBCConnection1;
  MetaData.MetaDataKind := 'Procedures';
  MetaData.Restrictions.Values['PROCEDURE_NAME'] := 'ADD_DETAILPO';
  MetaData.Active := True;
  while not MetaData.Eof do
  begin
    S := MetaData.Fields[2].AsString + AnsiString(#13#10) + S;
    MetaData.Next;
  end;
end;
the result just the name of procedure not detail of procedure.


Can you help me how to get DDL / detail Stock Procedure ? Cause I need to update Database and alter newer procedure on the same Procedure Name.

Thanks
Best regards.

Re: How TIBCMetaData to get detail Stock Procedure

Posted: Fri 23 Sep 2016 08:23
by ViktorV
Using the TIBCMetaData component, you can retrieve only the list of strored procedures and information about their parameters. Firebird architecture doesn't allow to get the full DDL of a stored procedure, so you have to generate it. For this, you can use the following recommendations:
- when setting the TIBCMetaData.MetaDataKind property to 'Procedures', you can get only the list of stored procedures.
- by setting this property to ProcedureParameters, you can get the needed information about parameters of stored procedures;
- body of stored procedure is stored in the RDB$PROCEDURE_SOURCE field of the RDB$PROCEDURES Firebird system table .