Know the name of StoredProcedure

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
calou
Posts: 116
Joined: Tue 27 May 2008 12:46

Know the name of StoredProcedure

Post by calou » Fri 21 Nov 2008 12:21

Hello,

I would like to know the names, of stored procedures in my FB database.

I try to use IBCMetaData but without success

IBCMetaData1.MetaDataKind:='Procedures';
IBCMetaData1.Open;

while not IBCMetaData1.Eof do
begin
ShowMessage(IBCMetaData1.FieldByName[???].AsString);
IBCMetaData1.Next;
end;

Is it possible to have the variables ant their kind too?

Thank you for help

Regards

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 24 Nov 2008 08:47

Do you mean parameters of stored procedures ?

calou
Posts: 116
Joined: Tue 27 May 2008 12:46

Post by calou » Mon 24 Nov 2008 16:25

Hello,

The twice if it is possible

Thank you

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Tue 25 Nov 2008 08:30

To get a procedure name from metadata, you can use the PROCEDURE_NAME field:

ShowMessage(IBCMetaData1.FieldByName['PROCEDURE_NAME'].AsString);

You can see all fields available in the TIBCMetaData component if you link it to the TDataSource and TDBGrid components.

To get parameters of a stored procedure, set MetaDataKind to 'ProcedureParameters' and add 'PROCEDURE_NAME=MYPROCNAME' to the Restrictions property.

calou
Posts: 116
Joined: Tue 27 May 2008 12:46

Post by calou » Tue 25 Nov 2008 20:18

Thank you plash

Haydar Aji
Posts: 7
Joined: Wed 22 Jun 2016 04:06

Re:how to get detail procedure

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

I can't get my detail procedure using this component. Can you help me how to get detail procedure ?
I've try this one :

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.
Plash wrote:To get a procedure name from metadata, you can use the PROCEDURE_NAME field:

ShowMessage(IBCMetaData1.FieldByName['PROCEDURE_NAME'].AsString);

You can see all fields available in the TIBCMetaData component if you link it to the TDataSource and TDBGrid components.

To get parameters of a stored procedure, set MetaDataKind to 'ProcedureParameters' and add 'PROCEDURE_NAME=MYPROCNAME' to the Restrictions property.

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

Re: Know the name of StoredProcedure

Post by ViktorV » Fri 23 Sep 2016 08:23

We have answered to you at the topic: viewtopic.php?t=34331

Post Reply