How TIBCMetaData to get detail Stock Procedure

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Haydar Aji
Posts: 7
Joined: Wed 22 Jun 2016 04:06

How TIBCMetaData to get detail Stock Procedure

Post by Haydar Aji » Fri 23 Sep 2016 02:01

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.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: How TIBCMetaData to get detail Stock Procedure

Post by ViktorV » Fri 23 Sep 2016 08:23

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 .

Post Reply