Page 1 of 1
Know the name of StoredProcedure
Posted: Fri 21 Nov 2008 12:21
by calou
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
Posted: Mon 24 Nov 2008 08:47
by Plash
Do you mean parameters of stored procedures ?
Posted: Mon 24 Nov 2008 16:25
by calou
Hello,
The twice if it is possible
Thank you
Posted: Tue 25 Nov 2008 08:30
by Plash
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.
Posted: Tue 25 Nov 2008 20:18
by calou
Thank you plash
Re:how to get detail procedure
Posted: Fri 23 Sep 2016 01:44
by Haydar Aji
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.
Re: Know the name of StoredProcedure
Posted: Fri 23 Sep 2016 08:23
by ViktorV
We have answered to you at the topic:
viewtopic.php?t=34331